Jump to content
  • Advertisement


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


gluPerspective() and perspective viewing volume

This topic is 6382 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

This is an introductory question regarding gluPerspective() and/or glFrustum(). Okay, Let''s say you call gluPerspective() with a fov angle of 60 degrees, an aspect ratio of 4/3, a near of 0.0, and a far of 100.0... e.g.,
glViewport(0, 0, fWidth, fHeight);


gluPerspective(60.0f, fWidth/fHeight, 0.0f, 100.0f);

The range of *visible* x and y coords changes, depending on the z-coord used...in other words, you can see more units on the x and y axises for an object which is "farther away", than for one that''s "closer". I need an algorithm where you can retrieve the viewable range of x-coords and y-coords, given a specific z-coord. In otherwords, retrieve the width and the height of the "frustum" at a given z-coord. This would allow me to tell if an object is visible to the user at certain x/y coords given the z-coord. I ought to be able to figure this out, but haven''t been able to yet. Any suggestions would be appreciated--or if there''s any major errors in my logic, I''d love to be corrected. Thanks Rob

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!