glFrustum / gluPerspective

Hi there.

I’ve read a few books on the two functions above and am wondering if theres any significant difference between the two?

i know that on gluPerspective you have to have a symetrical viewing volume along the h and w components and it’s more intuitive than glFrustum but is there anything else?

Which one would people recommend and why?

Cheers

Allan

glFrusmtum vs gluPerspective is a matter of taste. Use what you feel is more intinuitive and works best with your code.

The only real different is the way you setup the view volume. With glFrustum you set the coordinates of the view volume explicitly, and with gluPerspective you specify FOV. Other than that, they are more or less identical. glFrustum is a little more flexible.

glFrustum can support asymmetric frusta, where the angle to the left is greater than the angle to the right for example.

gluPerspective is basically easier to use than glFrustum - glFrustum is actually called from inside gluPerspective.

If you don’t like the glu library, (I don’t), then you can find source code in the OpenGL FAQ somewhere which shows how to implement what would be achieved in a gluPerspective call but instead with a glFrustum call.

Cheers Everyone

Allan