neoRiley Posted February 2, 2014 Share Posted February 2, 2014 In reading the tutorial here it says that mesh.rotate is based on eulers and is local BUT, if rotationQuaternion is set/in use, then rotation is not used at all in favor of rotationQuaternion. So, an example of how to rotate in world space was given, but nothing was said about how to rotate in local space if rotationQuaternion is in use. I can confirm that mesh.rotate does nothing if rotationQuaternion is in use. I'm not a quaternion expert, but my guess was that rotationQuaternion was local by default, and that if I did something like this:this.rotationQuaternion = this.rotationQuaternion.add(BABYLON.Quaternion.RotationYawPitchRoll(tempV3.y, tempV3.x, tempV3.z));it should work, but I get the craziest results. So that's bad apparently. Can someone shed some light on how to add to the rotation in local space when having to use rotationQuaternion? PS> I would like to suggest keeping both euler and quaternions updated for ease of use in the future. And even updating the API to be more like: rotation = world rotation in radianslocalRotation = local rotation in radianseulers = world rotation in degreeslocalEulers = local rotation in degrees This way, developers can do whatever they want however they want. Thanks for the help, John Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2014 Share Posted February 2, 2014 About the rotation using euler or using quaternion, I choose to prefer quaternion is rotationQuaternion is defined instead of rotation for performance reasons. I do not want to update my euler angles when quaternion are in use because it implies a test and a complex operation for every object in the scene on every frame I try to keep Babylon.js as simple as possible and frankly the rotation part is not my favourite J 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.