gluPerspective() / glOrtho() ??

Hi,
It may be a basic doubt…
What is the major difference between gluPerspective() and glOrtho() ?.In glOrtho(), we can specify the left,right bottom and top co-ordinates range.But in gluPerspective()there is any parameter for that.If any need for specifying if using gluPerspective() ?.If needed how i can specify ???

Thanks for any input,

Jerry

Ortho and Perspective are two diffrent render modes.

glOrtho draw’s every thing as if you where looking down at an image on a piece of paper.
Object do not get smaller as they move away from you.

gluPerspective gives a camara type function: field of view angle.
aspect ratio, how square the image is.
Area to render start point and end point on the z plane.
With Perspective mode of rendering objects look smaller as you move them away from the camara.
With gluPerspective use just the glViewport to set hight and width.

Originally posted by jerin3D:
[b]Hi,
It may be a basic doubt…
What is the major difference between gluPerspective() and glOrtho() ?.In glOrtho(), we can specify the left,right bottom and top co-ordinates range.But in gluPerspective()there is any parameter for that.If any need for specifying if using gluPerspective() ?.If needed how i can specify ???

Thanks for any input,

Jerry[/b]

More to the point (pun intended), the perspective projection setup by gluPerspective has a vanishing point, whereas the othognal projection setup by glOrtho has no vanishing point.

gluPerspective() is essentially a user friendly wrapper for glFrustrum(). If I remember right glFrustrum() uses the same parameters as glOrtho() namely left, right, top, bottom, near, far. But because its a perspective projection its not as intuitive to use a glOrtho() hence the heavy reliance on gluPerspective().

Feel free to correct me if I’m wrong.