This topic is now archived and is closed to further replies.


Calculate a Vertex from an Angle

Recommended Posts

MetaCipher    145
What I have is a Position Vertex, Heading, Pitch, and an Angle. I want to be able to move around on the X,Z plane. (Moving forward) I think I need to grab another Vertex (View) by using the Angle and Position, and then do something like this: TempVector.SetX(Position.GetX() - View.GetX()); TempVector.SetZ(Position.GetZ() - View.GetZ()); Position.SetX(Position.GetX() + TempVector.GetX() * Speed); Position.SetZ(Position.GetZ() + TempVector.GetZ() * Speed); Am I on the right track? Or is there some other way of doing this? P.S. This is how the Camera is set up. glRotatef(-Pitch, 1, 0, 0); glRotatef(-Heading, 0, 1, 0); glTranslatef(-Position.GetX(), -Position.GetY(), -Position.GetZ()); I got the idea from:

Share this post

Link to post
Share on other sites