Jump to content
  • Advertisement
Sign in to follow this  

Computing View Volume Parameters at Runtime

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

I have to compute the parameters of the view volume (Perspective - gluPerspective) at run time.

My approach is as follows

1. Find bounds of the mesh (xmin,xmax,ymin,ymax,zmin,zmax).
2. set znear = zmin + threshold, zfar = zmax + threshold. (threshold some constant value hard coded).
3. Compute distance = ZNear - ZPositionoftheCamera.
4. Compute fov = 2*tan-1(height/2*distance);

Are the above steps enough for computing view volume at run time?

[Edited by - rajesh_nest on September 2, 2010 11:18:50 AM]

Share this post

Link to post
Share on other sites
Hope My query did not confuse? Let me make it clear.

I am developing a meshviewer software. I was manually correcting parameters of Perspective viewing volume (fov,aspect ration,ZNear and Zfar), for the viewing the mesh.

Now I want the software to automatically compute parameters when the mesh is loaded. The steps listed above is suppose to do same.

But I am not sure, whether the steps are correct.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!