screenmutt Posted December 2, 2013 Share Posted December 2, 2013 Hello! I have the following object.function Model(name, scene) { this.mesh = // Cylinder this.x_speed = 0.10; this.y_speed = 0.20; this.z_speed = 0.05;};Every time step I update the x, y, z position of the mesh by adding the x, y, and z speeds to the position. What I would like to do is point the cylinder in the direction of travel. However, I am having a hard time figuring out what exactly the rotation attribute does. I've been able to set x, y, z values... but can't figure out a mapping. Can anyone shed light on this problem? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 4, 2013 Share Posted December 4, 2013 To do that, you could use two rotations:- mesh.rotate.x- mesh.rotate.y the rotation around y can be the same as your camera (around Y axis) 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.