Hi,
I'm just starting to get to grips with camera movement. At the moment I can move the camera forward and backwards. And strafe left or right. I'm doing this by changing the variables in gluLookAt ie:
Code :void display(void) { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(Xeye,Yeye,Zeye,XCentre,YCentre,ZCentre,0.0,1.0, 1.0);
Code :void keyboard(unsigned char key, int x, int y) { switch (key) case 's': Zeye += 0.1; glutPostRedisplay(); break; case 'w': Zeye -= 0.1; glutPostRedisplay(); break; case 'a': Xeye -= 0.1; XCentre -= 0.1; glutPostRedisplay(); break; case 'd': Xeye += 0.1; XCentre += 0.1; glutPostRedisplay(); break;
However I'm struggling to figure out how to change the angle at which I'm looking. That is to say imagine the camera was strapped to your head you would remain stationary but turn your head left or right. Really can't figure out how to do this. Could anyone give me some pointers?
Thanks so much.



