ChrisR Posted September 19, 2015 Share Posted September 19, 2015 Hey, Sorry for becoming the guy that always asks questions. I promise i look into everything quite hard before i ask here. I am after all trying to learn the wonderful world of 3D Space. So, this time, i am trying to get the world rotation of a Mesh. This mesh is the child of several other meshes. I am trying to multiply all the quaterions of its parent together to calculate its quaterion. Take a look: http://www.babylonjs-playground.com/#1JUUIH I want the final blue cube to have the same rotation as the original green cube. Now, if i take away the initial rotation of the cube by commenting out the line:cube.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(5, 0, 0);It works. But i am dealing with meshes that have their initial rotationQuaterion set. So after i rotate them then try to get its "world rotation" its not coming back properly. Is there some undertanding to this that i am missing? Thanks as always Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 22, 2015 Share Posted September 22, 2015 Hey, First - don't be afraid to ask questions. I think I wrote it a fe times already, but I guess it's worth repeating - there are no stupid questions. Especially a question like yours, which you invested quite some time trying to understand :-) So, first - http://www.babylonjs-playground.com/#1JUUIH#2 You were missing the last cube - you never multiplied the newRotation with the rotation of the last cube, which still has a rotationQuaternion. Is this what you were trying to achieve? Quote Link to comment Share on other sites More sharing options...
ChrisR Posted September 22, 2015 Author Share Posted September 22, 2015 Thanks Raanan, Yea, sometimes is the simplest of answers. I appriciate that, you solved it! 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.