I am new to OpenGL and was trying to create a simple maze that i can traverse through using a first person perspective. I have the maze rendering and all that just fine. But my first person camera perspective ends up being more of a third person camera. The camera revolves around a certain point infront of the camera.
My Code for actual rotation and translation
void camera(){
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(pitch, 1, 0, 0);
glRotatef(yaw, 0, 1, 0);
glTranslatef(player.x, player.y, player.z);
}
This is also the first translations and rotations that happen in rendering. Thanks for any help.
playerlocation changes when you rotate the view. - Nicol Bolasplayerand the camera when rotating revolves around that position. - Mirza