Sign in to follow this  

Computing View Volume Parameters at Runtime

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

This topic is 2660 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this