You dont even need to use gluLookAt. You can call OpenGL funcs to setup the camera also. Just put this in the beginning of your render func:
glLoadIdentity();
glRotatef(roll, 0.0f, 0.0f, 1.0f);
glRotatef(pitch, 1.0f, 0.0f, 0.0f);
glRotatef(yaw, 0.0f, 1.0f, 0.0f);
glTranslatef(-xpos, -ypos, -zpos);
Main Topics
Browse All Topics





by: ikeworkPosted on 2009-08-20 at 05:21:15ID: 25141489
Hi AntonKarlsson,
eye(X/Y/Z) -> "xpos, ypos, zpos"
center(X/Y/Z) -> Its the point the camera will look at, you have to calculate it from your input data "xpos, ypos, zpos, pitch, yaw and roll"
up(X/Y/Z) -> It defines how the camera looks at the center point. The Angle around its local z-axis, towards the scene.
The calculation is quite straight forward. Do you now how to apply "pitch, yaw and roll" in general?
ike