Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm making a 3D game in XNA4.0. How do I rotate a model to face the direction that the user is pressing. I assume I need to set its look at to the direction being pressed, but can't figure out how to do that.

Cheers.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can get the world matrix with Matrix.CreateWorld(Position, Direction, Up);

Direction is the forward vector of your model...

http://msdn.microsoft.com/en-us/library/bb975261.aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.