dreinzy Posted August 2, 2018 Share Posted August 2, 2018 I would like to be able to switch between ArcRotateCamera and FreeCamera with as little motion as possible. I haven't been able to figure out: 1) How to get the FreeCamera to face the same direction as ArcRotate was when switching. 2) How to remove the 'spinning' effect when switching. You can 'coil' a camera up by rotating it several times and after switching, it 'uncoils' itself by rapidly spinning. I thought that for FreeCameras this number is stored in .rotation.y and .alpha for ArcRotateCameras, but limiting these to ±Math.PI doesn't fix this issue. Don't really want to set inertia to 0 because I like inertia PLAYGROUND LINK Quote Link to comment Share on other sites More sharing options...
dreinzy Posted August 2, 2018 Author Share Posted August 2, 2018 Using a UniversalCamera instead of a FreeCamera, then using SetTarget after switching partially fixes part 1, although the camera always seems to be facing the way I want it to initially, inertia seems to carry over. https://playground.babylonjs.com/#DF2CNN#1 Quote Link to comment Share on other sites More sharing options...
dreinzy Posted August 2, 2018 Author Share Posted August 2, 2018 There is something I'm completely missing here. If I take away all inertia and only switch between cameras without setting positions/targets/anything. I expect any change in one camera to have no effect on the other, but this is not the case. Looking around with one camera changes the other's position/direction. https://playground.babylonjs.com/#DF2CNN#2 Quote Link to comment Share on other sites More sharing options...
Guest Posted August 2, 2018 Share Posted August 2, 2018 Hello this is because they are both attached to the canvas. You should attach only when the camera gets active: https://playground.babylonjs.com/#DF2CNN#3 You don't even need to turn inertia off then. 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.