I am trying to make a maze that someone can move through. The problem is that when I rotate the ‘camera’ in the ModelView matrix and then try to move forward the ‘player’ stills moves straight forward. Meaning that the ‘player’ continues along the z axis with no respect as to the angle of the view. I decided to use some trigonometry to find the amount of x and z that the ‘player’ moves each time using sin and cos. But when I put these equations into my program I get unpredictable results. Sometimes I go up, others I go straight along the z axis. It even messes up when I try to go forwards without even turning. It usually goes off to the left. I don’t have my code with me but basically I:
- do rotations
- do translations
- draw world
Should I do it in a different order or something? Am I using the wrong trig functions? Thanks for any replies. My friend and I are just starting with OpenGL. When I have me code I will post it. Thanks again.