Skip to main content
GameDev.net gamedev.net
🔒 Locked

orthogonal view

Started by ogl Oct 12, 2000 at 4:04 AM 1 replies 350+ views
Original Post
ogl
ogl
Hi, I have implemented a scene with perspective view, I would like to view it in orthogonal view as well, how do I do this - basically toggling between the two (I know I have to use glOrtho)
Julien
Julien
I''ve never tried it but I think you could call your "reshape" function, where you setup your viewport and projection method, and choose between persp or ortho according to the expected state.

My Web Page
Bad Monkey
Bad Monkey
    
void SetProjection( bool bln_Perspective )
{


if( bln_Perspective )
{
// Set a perspective projection

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(...) // or glFrustum(...)
glMatrixMode(GL_MODELVIEW);
}
else
{
// Set orthographic projection

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(...);
glMatrixMode(GL_MODELVIEW);
}


}


There''s the simple way to do it. Just have a booloean var that determines which projection you''re going to use (this can be changed to true/false in your key handler or whatever).

Obviously you''ll have to play with the params for gluPerspective(...) and glOrtho(...) to get the look you want.

Hope that helped

------------------------------------------------------
"You need a weapon. Look around you... can you construct some sort of rudimentary lathe?"
- Guy Fleegman, Security Officer, NSEA Protector

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.