Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Leroy1891

Near and far values

This topic is 5374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!