Newlearner Posted May 31, 2017 Share Posted May 31, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 31, 2017 Share Posted May 31, 2017 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 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted May 31, 2017 Share Posted May 31, 2017 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 Quote Link to comment Share on other sites More sharing options...
Newlearner Posted June 1, 2017 Author Share Posted June 1, 2017 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... Quote Link to comment Share on other sites More sharing options...
Newlearner Posted June 1, 2017 Author Share Posted June 1, 2017 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. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 1, 2017 Share Posted June 1, 2017 Was it solved in your other post with the inertia? You can mark as solved, if so. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.