Ahiru Posted September 3, 2015 Share Posted September 3, 2015 In this example I watched: http://www.babylonjs-playground.com/#1RWE59#32 The camera shows a strange movement (jumping) when you watch from below. Why is that? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 3, 2015 Share Posted September 3, 2015 Hi Ahiru I believe the camera is gimbal-locking, but I'm not completely sure about that. Adding camera.upperBetaLimit = 3.14; (or less) should solve the problem. 3.14 is slightly less than Math.PI. Math.PI is the default upperBetaLimit, happening when the cam is directly beneath the scene. Setting it to 3.14 keeps the camera from extending to its full beta limit (Math.PI)... a place where gimbal lock is most-likely to occur. You can test this by setting camera.upperBetaLimit = Math.PI; which will cause the problem to remain/return. Setting camera.upperBetaLimit = 3.15 ...also works, but maybe not as consistently as 3.14. Excellent observations, Ahiru! If this IS gimbal lock, it's the first time I have seen it happen right before my eyes. Interesting! I THINK that the tiny value-offset from a dead limit like this... is called an epsilon value. In our case, Math.PI - 3.14 = epsilon value. No promises, I'm far from being an expert in these matters. Be well! Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 3, 2015 Author Share Posted September 3, 2015 I will play definitively around with it - would be my first observation of these Gimbal-locking, too, but I thought internally the rotation is handled by quaternions? For my taste I don't like the ArcRotate Camera have any Alpha and Beta limits at all, was very confused with this camera first to experience this locks. When I set up scenes I like to have the Beta limit totally removed. But IF it is Gimbal-locking, maybe we can make a tutorial out of it to explain what it actually is? Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 3, 2015 Author Share Posted September 3, 2015 But even now it behaves probably not like expected, will try that with a more 3D-Object soon. http://www.babylonjs-playground.com/#1RWE59#34 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 3, 2015 Share Posted September 3, 2015 Hi again! but I thought internally the rotation is handled by quaternions? https://github.com/BabylonJS/Babylon.js/pull/630 "Warning here: only the followCamera uses the rotationQuaternion. All others cameras only use euler rotation" Also... http://www.html5gamedevs.com/topic/14688-quaternion-arcrotatecamera - possibly of interest. Bye again. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 3, 2015 Share Posted September 3, 2015 is this better?http://www.babylonjs-playground.com/#1RWE59#35 jerome and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 3, 2015 Author Share Posted September 3, 2015 Is there a difference? - AND: Should there be a difference? I thought the Alpha-Limits are set to null anyway?:export class ArcRotateCamera extends TargetCamera {...public lowerAlphaLimit = null;public upperAlphaLimit = null; Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 3, 2015 Author Share Posted September 3, 2015 Maybe like this, but the scoll-wheel does not behave like I want. http://www.babylonjs-playground.com/#YRIPX#8 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 4, 2015 Share Posted September 4, 2015 No there are not set to null (Beta is the problem here):https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.arcRotateCamera.ts#L10 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 4, 2015 Author Share Posted September 4, 2015 Yeah, I know, but I nulled them in this one already as far as I remember? (Unfortunately I can't check at the moment - my playground does not load) So that's why I asked if there is any difference in yours and that one. (Maybe I missed something?) But even now it behaves probably not like expected, will try that with a more 3D-Object soon. http://www.babylonjs-playground.com/#1RWE59#34 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 4, 2015 Share Posted September 4, 2015 Sorry I did not see your second PG. So yes no difference But then I do not see the bug you mentioned: There is no jump for me in your second PG Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 4, 2015 Author Share Posted September 4, 2015 Well, try to swing right left a bit, while yawning up. When reaching a special point you will see, that the right-left swing is interrupted and your mouse-swing works exactly turned like before. Should be better with this one: Maybe like this, but the scoll-wheel does not behave like I want. http://www.babylonjs-playground.com/#YRIPX#8 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 4, 2015 Share Posted September 4, 2015 Nope Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 5, 2015 Author Share Posted September 5, 2015 Sorry ambassador, but I have to disagree with you, unfortunately. Open them side by side, and compare the movements if you turn them around. The ArcRotateCamera shows unnatural behaviour, switching from a left to a right swing unexpectedly (from a user's viewpoint unexpected, not mathematically). The second one is how I would expect a Rotational Camera to work? Maybe not perfect yet, but no sudden swings? http://playground.babylonjs.com/#1RWE59#35 http://playground.babylonjs.com/#YRIPX#11 Anyone else agrees or disagrees? Quote Link to comment Share on other sites More sharing options...
striess Posted September 18, 2015 Share Posted September 18, 2015 Hi Ahiru, I fully aggree with you. For an application working on win 7 with big touch screens in a production environmentwe are testing to use the ArcRotateCamera for visualizing the processing of the current work piece. In this scenario it's nearly impossible for the user to control the rotation of the ArcRotateCamera.I've tried some optimizations, but ist not satisfactorily. Your second one http://babylonjs-pla...s.net/#YRIPX#11 behaves much more as the user expects. Unfortunately the zoom function doesn't work with that. Do you already have found a solution for the zoom function to? Best regards from Germany Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2015 Share Posted September 18, 2015 I do not get the problem still. Can you try guys to make it clearer? or provide a video? @Striess: what do you mean with "zoom function does not work?" Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted September 18, 2015 Share Posted September 18, 2015 DK, I think they mean, in http://playground.babylonjs.com/#YRIPX#11 the user can rotate the object as if he were really touching it and then rotating it thanks to finger friction. That's not the movement feeling we have using the ArcRotate by default. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted September 18, 2015 Share Posted September 18, 2015 (but we are so accustomed rotating object with the mouse we don't get that anymore ) Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 I was first thinking about using the Three.js way - rise or lower the FOV - but I don't like the stretching effects that come with it.At the moment working on some Octree problem, but will come back to it for sure - if possible give it the same properties like the actual camera has.Use the upper link (the #35) one and rotate a bit - you will see the jumping behaviour. And how can I attach a video here? Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 19, 2015 Author Share Posted September 19, 2015 http://playground.babylonjs.com/#1PGAPW#2 Wheel does work now - but no mobile here to check the gesture-thing. Quote Link to comment Share on other sites More sharing options...
Punn Posted September 20, 2015 Share Posted September 20, 2015 You should add keyboard supply, like the arrow keys. Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 20, 2015 Author Share Posted September 20, 2015 Yes - you might be right - I never use the keyboard to control the camera, that's why I forgot - will add it in the evening - maybe it's more clear than to see the difference for people with only Laptop-Trackpads. Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 20, 2015 Author Share Posted September 20, 2015 (edited) Since DK asked me to demonstrate the difference in a screencast: ArcRotate.movArcRotate3.mov With ArcRotateCamera:http://www.babylonjs-playground.com/#1PGAPW#4 With TemechonCamera: http://www.babylonjs-playground.com/#1PGAPW#9 Try especially to do diagonal mouse-movements. Using keyboard should work now, too. Edited September 21, 2015 by Ahiru Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted September 24, 2015 Share Posted September 24, 2015 I think both methods make sense, depending on the final purpose.I suggest we create a new flag in ArcRotate (like "allowUpsideDown" one) to choose between the two methods. Ahiru 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 24, 2015 Share Posted September 24, 2015 Agree! 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.