I consider myself fluent in OpenGL. But I have hit a problem with a little demo I am working up to show how to do First Person with my GLH library.
I define a matrix for the transposed view.
m[16];
then i setup a routine to modify the matrix.
glLoadMatrix(m);
glTranslatef(x,0,speed);
glRotatef(pitch,1,0,0);
glRotatef(yaw,0,1,0);
glGetFloatv(GL_MODELVIEW_MATRIX,m);
then the draw code.
glLoadIdentity();
glMultMatrix(m);
//Draw terrain
the problem is that the pitch plane dose not move, so when i turn to the side, and try to look down the screen just spins, cause the pitch plane is focused to my side. It shouldn't do that when i load the matrix, rotate it, then save it back.
the order of the glRotatef()'s makes no difference.