Original Post
I'm trying to program a first person camera without gluLookAt. Currently, i'm using the pilotView method given in the red book: void pilotView() { glRotated(pitch, 0.0, 1.0, 0.0); glRotated(heading, 1.0, 0.0, 0.0); glTranslated(-camx, -camy, -camz); } My keyboard function is this: void myGlutKeyboardCallback(unsigned char key, int x, int y) { if(key =='a') { camx--; } if(key == 's') { camz++; } if(key == 'd') { camx++; } if(key == 'w') { camz--; } if(key =='r') { camx = 0.0, camy = 10, camz = 50; } if(key == 27) { exit(0); } glutPostRedisplay(); } The problem is that if i'm not facing down the z=0 axis, the translate command obviously doesn't work properly since it has no knowledge or the direction the camera is facing. Can someone help me out?