#### Archived

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.

## 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); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60.0f, fWidth/fHeight, 0.0f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); 
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 on other sites
have a look in the red book
also a near plane of 0.0 aint good me son

http://members.xoom.com/myBollux

1. 1
2. 2
Rutin
24
3. 3
JoeJ
19
4. 4
5. 5

• 17
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631730
• Total Posts
3001917
×