How do i create a rotation matrix given a direction vector?
I am 开发者_开发技巧trying to rotate an object to face the direction it is moving in. We want it to face the normalized velocity vector.. help... pls...
Have you tried Matrix.CreateLookAt
(MSDN)?
// Matrix.CreateLookAt(eyeLocation, lookAt, upVector);
Matrix.CreateLookAt(currentPosition, currentPosition + velocity, Vector.Up);
精彩评论