Sign in to follow this  

multi-viewport aspect ratio object sizes howto

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

there are 2 viewports, one is 800x500 and the other is 800x100. how to code such that the object in those viewports will not be distorted, that is the objects should remain its original shape. For example, a square box should have a square look in them. ciao

Share this post


Link to post
Share on other sites

//pseudocode
for each viewport {

glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( viewport_fovY, viewport_aspect, NearPlane, FarPlane );
glMatrixMode( GL_MODELVIEW );

render_scene();
}

*) float viewport_aspect = viewport_width / viewport_height;

... something like this..? ^^;

Share this post


Link to post
Share on other sites

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