Bagel Posted February 23, 2016 Share Posted February 23, 2016 Hello, I'm brand new to babylon.js. I'm working on making a sphere roll. I have it set up to roll of a keystroke event. How I set up getting my ball rolling is: sphere.rotation.z -= rightSpeed; sphere.rotation.z += leftSpeed; sphere.rotation.x += forwardSpeed; sphere.rotation.x -= backSpeed; These are being handled as the key is being pressed down. Obviously there is a flaw in the way I'm implementing this as I rotate my z axis to the point that when I go to turn right and left it looks similar to the earth rotating. I'm just hoping someone can point me in the right direction so that as I move forward, back, left, right (along with their combinations) that I can get the sphere to rotate in the appropriate direction. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 24, 2016 Share Posted February 24, 2016 Hello and welcome! First thing to read: http://doc.babylonjs.com/overviews/How_Rotations_and_Translations_Work You will love the mesh.rotate() function I guess adam 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.