How can I implement smooth rotation from one direction to another?

Posted by user1759052 on Game Development See other posts from Game Development or by user1759052
Published on 2012-10-19T14:12:20Z Indexed on 2012/10/19 17:19 UTC
Read the original article Hit count: 148

Filed under:
|
|
|

I'm having a problem with animating rotations with 1Matrix.CreateRotationY() with my basic 3D game. Based on where you click the mouse, I want the 3D object to rotate to that direction and then move.

I am using this to determine the target direction:

float rot = (float)(Math.Atan2(X, Z));

It gives me the correct value, but I am not sure how to handle the rotation animation from current direction to new direction. I've tried a few things, but to no avail.

Do you guys know of any good ways of solving this issue?

© Game Development or respective owner

Related posts about c#

Related posts about xna-4.0