Advertisement

Near and far values

Started by March 04, 2004 08:39 PM
1 comment, last by Leroy1891 21 years ago
How do I check what the near and far depth values are. I''m talking about the last 2 parameters to gluPerspective. Thanx in advance.
Well, as far as I know, you don''t have to retrieve those values from somewhere, you can set them yourself. I think that the first one tells OpenGL where to stop rendering a poly if it is in front of you. Sort of if you had a ball rushing toward the camera, if it is less than X distance away from the camera, than it is not actually displayed on the screen. The inverse goes for the Far value. It stops displaying the poly if it is more than that distance away from the camera. If an object is more than that distance away, OpenGL wont even render it.
I might be wrong tho.

The values I use are .1f and 1000.0f myself.

Good Luck!

Advertisement
Well you may want to extract them from the projection matrix in order to create a frustum to use for clipping in a scene tree. Have a look here for a way to extract the view frustum from a projection matrix, it shouldn''t be too hard to use that information to work out the near and far values.

This topic is closed to new replies.

Advertisement