开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜