Near/Far Clip

Started by
4 comments, last by zedzeek 18 years, 10 months ago
Is there a way to get what the near and far clip are set to directly from OpenGL?
Advertisement
If you get the projection matrix, you can solve for the near and far planes.

This page has the OpenGL perspective projection matrix.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
I looked into it, but it seems it can't be done by using glGet...() according to this site

Maybe you can derive them from the projection matrix, but I have no idea how.
I'm probally beter off just storing what I use on initialization then, you think?
Quote:Original post by Phy
I'm probally beter off just storing what I use on initialization then, you think?

Yes. Getting data from opengl is never a good idea if you can get it from somewhere else. (Specially if you pass it to opengl before.)
You should never let your fears become the boundaries of your dreams.
promit is correct with the glgetfloat projection matrix u could do a bit of math to work it out (theres is no getget near/far plane command in case thats what u thought)
but then again as others have said youve already told gl what the near/far planes distances are (with gluPerspespective/glFrustum()) + u wanna ask it for them again, do u have a short memory :)

This topic is closed to new replies.

Advertisement