Original Post
🔒 Locked
Stupid Question
Advertisement
>>Why can't you just use OpenGL to draw these simple objects >>things?
I wanted to avoid re-drawing the entire scene. I wanted to draw my simple object without having to go through the trouble of rendering the complex static scene in the backgorund.
>>If you're taking about 2D menus or buttons, use the ortho >>projection.
I'm not sure what you mean by this. Do you mean create a second view port and rendering it below another view port (a window with two view ports; one covering the top half of the window another covering the bottom half). I trying to draw my simple object over my scene. Thanks for the help. It's appreciated.
I wanted to avoid re-drawing the entire scene. I wanted to draw my simple object without having to go through the trouble of rendering the complex static scene in the backgorund.
>>If you're taking about 2D menus or buttons, use the ortho >>projection.
I'm not sure what you mean by this. Do you mean create a second view port and rendering it below another view port (a window with two view ports; one covering the top half of the window another covering the bottom half). I trying to draw my simple object over my scene. Thanks for the help. It's appreciated.
Quote:
Original post by fathom88
>>Why can't you just use OpenGL to draw these simple objects >>things?
I wanted to avoid re-drawing the entire scene. I wanted to draw my simple object without having to go through the trouble of rendering the complex static scene in the backgorund.
Why would you have to re-draw the entire scene? I don't understand.
Quote:
Original post by fathom88
>>If you're taking about 2D menus or buttons, use the ortho >>projection.
I'm not sure what you mean by this. Do you mean create a second view port and rendering it below another view port (a window with two view ports; one covering the top half of the window another covering the bottom half). I trying to draw my simple object over my scene. Thanks for the help. It's appreciated.
No second viewport is necessary. After rendering the 3D scene, just push an orthographic projection on the projection matrix stack and draw your 2D objects. Just make sure you disable depth buffer reads to make sure 2D stuff is always on top.
Tom
I looked around a bit, it could be done done with a single buffered opengl( at least in winnt), But mixing the two is really slow, and basically a bad idea.
And the ortho stuff draws on top of your scene.
Basically you draw you 3d stuff like normal. And after you've drawn finished drawing your scene, you then draw some 2d stuff on top with opengl.
I'm writing this from memory, so I hope I got everything
And the ortho stuff draws on top of your scene.
Basically you draw you 3d stuff like normal. And after you've drawn finished drawing your scene, you then draw some 2d stuff on top with opengl.
I'm writing this from memory, so I hope I got everything
//All the 3d stuff is drawn by this pointglMatrixMode(GL_PROJECTION);glPushMatrix();glOrtho(...); //uses what ever settings work for the 2d stuff you want to drawglMatrixMode(GL_MODELVIEW);glLoadidentity();glDisable(GL_DEPTH_TEST);//Now draw your 2d stuff here with opengl, if you need to keep your 3d modelview matrix you can push it before glLoadIdentity, and pop it after drawing 2d stuff.glEnable(GL_DEPTH_TEST);glMatrixMode(GL_PROJECTION);glPopMatrix();glMatrixMode(GL_MODELVIEW);
Do yo mean that you have a complex scene that you want to render ONE TIME, and some other objects (simple ones) that will be rendered repeatedly on top?
If that's the case, you can either render to a texture ONE TIME and display the result in the background on a textured quad, or you can just load the background from an image if its static in that sense, and if your circumstances permit.
If that's the case, you can either render to a texture ONE TIME and display the result in the background on a textured quad, or you can just load the background from an image if its static in that sense, and if your circumstances permit.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement