Mars Posted December 30, 2016 Share Posted December 30, 2016 var cylinder = BABYLON.Mesh.CreateCylinder("cylinder", 10, 10, 10, 10, 1, scene, false); cylinder.rotation.x = -Math.PI/2; engine.runRenderLoop(function () { cylinder.rotation.z += 0.01; scene.render(); }); This should be rotation by z, but it rotation by y??? If I change the "cylinder.rotation.z += 0.01;" to "cylinder.rotation.y += 0.01;", it have the same result. Why? Quote Link to comment Share on other sites More sharing options...
iiceman Posted December 30, 2016 Share Posted December 30, 2016 Hi Mars, let's make a playground so that we can all see what you mean: http://www.babylonjs-playground.com/#TRIV4#0 I think that problem is that when you rotate the cylinder around it's x-axis the direction of it's z-axis changes. Not sure what you final goal is, but if you jsut want a cylinder laying on its side and beeing rotated, you could bake the first rotation into the cylinder and then do the other rotations: http://www.babylonjs-playground.com/#TRIV4#1 Is that the desired result? Quote Link to comment Share on other sites More sharing options...
Mars Posted December 31, 2016 Author Share Posted December 31, 2016 Yes. That is what i need. Thanks. 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.