tags:

views:

29

answers:

1

Ok so I have a ship which moves up and down based on the axis regardless of where the ship is facing.

How do I make the ship move in the direction it's facing? i.e. if my ship is facing east, key up makes it go north rather than east.

A: 

Your question isn't very clear - I will assume you're using models and matrices (as opposed to SpriteBatch or something else). So, making a guess - I'd say that the order of your matrix operations is incorrect.

This answer to a similar question may help.

Each matrix operation happens around the origin. So if you're doing your rotation after you move your ship into position, your rotation will also effectively "rotate" the direction of movement.

Andrew Russell