Turning toward coordinates

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Methuselah
Posts: 19
Joined: Fri Nov 24, 2006 9:33 am

Turning toward coordinates

Post by Methuselah »

How can I turn a mesh toward certain coordinates?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

get the nodes current rotation
find out what the final rotation needs to be( can be found by taking the target object you want to look at, subtracting the current nodes position and normalizing that vector. Then you can use the vector functions for getting the angles from said vector )
the node needs angular rotation per second speed, take the nodes current rotation and add to it, the said angular rotation per second( accounting for time between renders and the difference between the current and final rotations )
Image
Post Reply