View Full Version : about gluLookAt

07-27-2010, 08:21 AM
I have a few questions about gluLookAt and it would be great if someone can clear them up for me....

What will the result be, or what is the difference between glRotatef(60.0, 1,0,0) and gluLookAt(60, 0, 5.0, 0,0,0,0,1,0)?
Are they both rotating? I also have the same question about translation, what is the difference between translating and changing a value in gluLookAt();

Thanks for reading and answering.

07-27-2010, 10:55 AM
You can look at the docs for gluLookAt, which usually shows how the matrix is built.

Here for example, you can see that gluLookAt builds a rotation matrix and then translates the camera after it is applied. As you probably see, you can get along without gluLookAt by using the transform calls directly, but it's just a convenience.

glMultMatrixf(M); glTranslated (-eyex, -eyey, -eyez);