Jump to content

Arc rotate camera reposition


Newlearner
 Share

Recommended Posts

Hi,

I have created the object on Babylon Js and can able to rotate and view the object using arc rotate camera. My requirement is:

1. I positioned the camera on some position.

2. When the user click and move the mouse on canvas, can able to rotate the object.

I have done the above things

Whenever the user release the mouse on canvas while rotating, the camera back to the default position of initial stage.----> This is my requirement.

Can anyone help on this?

Link to comment
Share on other sites

18 hours ago, Deltakosh said:

Help us helping you :)

Please create a simple repro in the PG with your current setup. We can then improve it to help you meet your requirements

Hi, thanks for your interest to help me

www.babylonjs-playground.com/#12WBC#69

In this example using arc rotate camera and three plane (red, green, blue) are there. When you run this code, those three planes are shown as front view... After rotating the camera using mouse you can change the plane view. Here, when you release the mouse while rotating, those three planes are back to front view which was initial view of plane. That means we need to change the alpha, beta value of camera.... But that is not working properly.... And that should smoothly reposition... Instead of suddenly change the alpha, beta value. I hope this would be more clear for you...

Link to comment
Share on other sites

16 hours ago, brianzinn said:

Something like this should work.  If you want it without an animation, just set the alpha/beta/radius directly.  Inspired from a post by mattx264.

https://www.babylonjs-playground.com/#S64WPD

Thanks for your reply, I was expecting this.. But small issues are there, when you move the mouse slowly that is working properly, if you move the mouse faster to rotate the camera, that is act like elastic easing effect and also not placed on expected position.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...