openGL, fustrum and perspective

Started by
1 comment, last by Brother Bob 18 years, 5 months ago
i am a bit confused about the difference between glFustrum and gluPerspective. why do you use glFustrum to set up perspective, doesnt gluPerspective do basically the same thing but in a simpler way?
Advertisement
Very brief answer: glFrustum() allows you to set up an arbitrary, off-axis frustum. gluPerspective() basically wraps glFrustum(), allowing you to create a symmetrical frustum with somewhat more intuitive arguments.
gluPerspective is a specialized function for creating a symetric view volume based on a view angle, and ultimately calls glFrustum. glFrustum is a more generic function which gives you more control of the shape of the view volume.

In some cases, glFrustum is the simplest of the two; it's a matter of what information and requirements you have when you specify the view volume. If you have a view angle and want a symmetric view volume, then gluPerspective is obviously a better choise, as that's the kind of parameters it takes and the kind of shape it generates. If you need to control how coordinates are mapped from eye space to window space, then glFrustum is a better choise, as that's the kind of parameters it takes.

This topic is closed to new replies.

Advertisement