yuccai Posted July 24, 2014 Share Posted July 24, 2014 Hello ! There are something i don't understand regarding mesh rotation. 1) i find the y positive rotation wrong but maybe it's because the basis is indirect.2) when i rotate a mesh, does its rotation axis also turn? Here is an example : http://www.babylonjs.com/playground/#XXH6D#5There are 4 boxes :box1.rotation = (0,0,0)box2.rotation = (0,0,0)box3.rotation = (PI/2,0,0)box4.rotation = (PI/2,0,0) in the render loop box1.rotation.z += 0.01box2.rotation.y += 0.01box3.rotation.z += 0.01box4.rotation.y += 0.01 there is no problem for box1 and box2 (even if i think that box2 should turn in the other way) but box3 and box4 are turning on the same axis in opposite way. I don't understand why. Thank you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 27, 2014 Share Posted July 27, 2014 No replies from the experts here, yet, yuccai? hmm. Well, me posting this worthless reply will bring the issue back to the top of the forum list. I think boxes 1-3 are acting correctly, but box 4... phew. It is acting very strangely, in my opinion. Quote Link to comment Share on other sites More sharing options...
yuccai Posted July 27, 2014 Author Share Posted July 27, 2014 Thanks for your reply Wingnut ! It also confirm my doubt Quote Link to comment Share on other sites More sharing options...
binyan Posted July 29, 2014 Share Posted July 29, 2014 Hi yuccai,I think you should take a look at this topic (for instance this post). Maybe it would be helpful to you to use mesh.rotate(BABYLON.Axis.X , Math.PI/2, BABYLON.Space.WORLD) instead of mesh.rotation = (Math.PI/2,0,0) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 30, 2014 Share Posted July 30, 2014 This is all about local against global rotations https://github.com/BabylonJS/Babylon.js/wiki/How-to-handle-rotations-and-translations By the way to get global rotation, just use mesh.rotate function with BABYLON.Space.WORLD parameter 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.