Original Post
🔒 Locked
User Interface...
Advertisement
well the most obvious way would be to billboard all of your interface with depth testing turned off. What I would do though is render your scene then set up your gui by pushing the projection and modelview matrix and switching to orthographic mode so that no biboarding will be required and the positions wont change. Once the interface is drawn then you just pop the matrices.
The basic idea is:
1) Draw all 3D stuff
2) Set the projection to Ortho mode and draw all your 2D stuff without using the depth buffer (or you can do if you know what ur doing). A typical setup would look like this:
[edited by - JuNC on March 1, 2003 11:31:19 AM]
1) Draw all 3D stuff
2) Set the projection to Ortho mode and draw all your 2D stuff without using the depth buffer (or you can do if you know what ur doing). A typical setup would look like this:
void Do2D(void)
{
glDisable(GL_DEPTH_TEST);
glColour3f(1,1,1);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(1,-1,-1,1,-9999,9999);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// bind the texture I want to show on the first quad
glBindTexture(GL_TEXTURE_2D,my_quad_texture);
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex3f(0.25,0.25,0);
glTexCoord2f(1,0); glVertex3f(0.25,0.5,0);
glTexCoord2f(1,1); glVertex3f(0.5,0.5,0);
glTexCoord2f(0,1); glVertex3f(0.5,0.25,0);
glEnd();
}
[edited by - JuNC on March 1, 2003 11:31:19 AM]
Or... look into glOrtho, for 2D in opengl, you can over-lay it over your 3d stuff without issue. I have an alright GUI done in OpenGL that uses this, and it can be thrown over-top of anything (or given it's own background). It supports multiple windows, and objects. The objects can be owned by a window, or by the GUI itself (then it just gets drawn over the background, and not on a window). Windows can be moveable or not, etc. If you're interested in the sources, let me know.
Billy
Ready4Dis@aol.com
aol im = CrazyGuy4Eva
msn messenger = Ready4Dis_1@hotmail.com
Some screen shots of my GUI in action...
http://ready4dis.8m.com/Images/Screeny.jpg
http://ready4dis.8m.com/Images/Screeny2.jpg
http://ready4dis.8m.com/Images/Screeny3.jpg
http://ready4dis.8m.com/Images/Screeny4.jpg
http://ready4dis.8m.com/Images/Screeny5.jpg
http://ready4dis.8m.com/Images/Screeny6.jpg
http://ready4dis.8m.com/Images/Screeny7.jpg
[edited by - Ready4Dis on March 1, 2003 11:35:19 AM]
Billy
Ready4Dis@aol.com
aol im = CrazyGuy4Eva
msn messenger = Ready4Dis_1@hotmail.com
Some screen shots of my GUI in action...
http://ready4dis.8m.com/Images/Screeny.jpg
http://ready4dis.8m.com/Images/Screeny2.jpg
http://ready4dis.8m.com/Images/Screeny3.jpg
http://ready4dis.8m.com/Images/Screeny4.jpg
http://ready4dis.8m.com/Images/Screeny5.jpg
http://ready4dis.8m.com/Images/Screeny6.jpg
http://ready4dis.8m.com/Images/Screeny7.jpg
[edited by - Ready4Dis on March 1, 2003 11:35:19 AM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement