Skip to main content
gamedev.net
🔒 Locked

Screen change

Started by redcliffe Aug 9, 2002 at 3:09 AM 4 replies 450+ views
Original Post
redcliffe
redcliffe
In OpenGL how can I change the screen mode from ortho 2d to the normal 3D mode? Basically I''m asking how do I change from my splash screen to the 2d menu, and the into the 3D game? Thanks, David
branhield
branhield
im not sure if this is what you are lookin for, but here u go anyways...


      
bool bInMenu = false;

if(bInMenu)
glOrtho(...);
else
gluPerspective(...);


[edited by - branhield on August 9, 2002 11:59:25 AM]
redcliffe
redcliffe
quote:
Original post by branhield
im not sure if this is what you are lookin for, but here u go anyways...



        
bool bInMenu = false;

if(bInMenu)
glOrtho(...);
else
gluPerspective(...);


[edited by - branhield on August 9, 2002 11:59:25 AM]

I think so. You can do that swap at any time while the program is running can''t you? Thanks,

David
redcliffe
redcliffe
quote:
Original post by branhield
im not sure if this is what you are lookin for, but here u go anyways...



        
bool bInMenu = false;

if(bInMenu)
glOrtho(...);
else
gluPerspective(...);


[edited by - branhield on August 9, 2002 11:59:25 AM]

I think so. You can do that swap at any time while the program is running can''t you? Thanks,

David
merlin9x9
merlin9x9
Any time, yes, but you must make sure that you modify the projection matrix by making the appropriate call to glMatrixMode.
SilentReaper
SilentReaper
That''s basically how I do it in my games as well. Does anyone know if this is the most performant way to switch between the two? I have some objects I''ll draw at the end of the frame before I swap buffers, like frame rate output, a HUD, or a console and the text on it. I represent these as 2-D objects that I scale by some factor depending on the screen resolution. So depending on the view when rendering an in-game scene, I start out in Perspective, switch to Ortho, then back to Perspective and do it all over again. Just wondered how other people handle 2-D objects in 3-D scenes.

Topic Locked

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

Sign in to reply to this topic.