ZeroAT Posted April 15, 2018 Share Posted April 15, 2018 Is there any way to print the current rotation angle? I am currently using the code below, but I only want it to rotate 180 degrees instead of 360 degrees. I think I need to compare values with MATH.PI, but I am not sure what the other value would be because I have no idea how to figure out the current angle of rotation. As shown in the image below, I need to be able to retrieve x,y,and z to compare values. Any ideas on how to get these values? BABYLON.SceneLoader.ImportMesh("",'', "ship.babylon", scene, function(newMeshes){ ship = newMeshes; ... ... .. ship[0].rotate(BABYLON.Axis.Y, Math.PI / 2, BABYLON.Space.WORLD); Quote Link to comment Share on other sites More sharing options...
JohnK Posted April 16, 2018 Share Posted April 16, 2018 Hi @ZeroAT and welcome to the forum. If you want to turn the ship 180 degrees from current position you can use .addRotation http://doc.babylonjs.com/babylon101/position#sequencing-rotations If you want Euler Angles the you can convert from the quaternion http://doc.babylonjs.com/resources/rotation_conventions#quaternions-to-euler-angles Hope this helps. Ask again if you need more help. trevordev 1 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.