View Full Version : glFrustum vs gluPerspective

08-31-2000, 09:38 AM
Would anyone explain the difference between glFrustum and gluPerspective? I've written a small program where you can travel around a cube in space. I've read the section of the red book that talks about translations and rotations, but I don't see any difference in results when I change the order of rotation and translation commands with glFrustum. However, when I use gluPerspective, everything is as it should be.

Another thing. The farther from the viewpoint is your near clipping plane, the greater is the perspective division, but I can't figure the distances to near and far clipping planes that produce a nice effect.

Something else again. Is it a good choice to use gluLookAt instead of trying to find a sequence of translations and rotations?

Thank you.

[This message has been edited by Aster (edited 08-31-2000).]

08-31-2000, 09:49 AM
I'll just answer the first question.

glFrustum and gluperspective does the same thing.

Actually gluPerspective probably calls glFrustum. It uses the angle you passed as well as your near clipping plane to calculate the left coodirnates.(simply trigo)

then right = - left
bottom = ratio*left;
top = -bottom

so you probably just got lucky when you use glFrustum and the order of transformations did not matter. It is probably because you pick a viewing volume that was too large.