Hello
I can put up a bitmap up on the screen with the following code, but, It’s not 2d. It’s 3d… and when my first person walks up “very close” to other 3d objects in the scene, the bitmap will get clipped and partially obscured by them.
This doesn’t happen with text I put up on the screen, like, frame counters ect.
I’m weaving in and out of the projection and modelview matrices pretty much in the same manner in my renderScene() function in both cases.
So, I was wondering if somebody had some ideas about making my bitmap “truly 2d”.
Thanks in advance
Radar
This is really 3d and not 2d:
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f );
glMatrixMode( GL_MODELVIEW );
// Strange…I have to enable depth testing or it will get drawn behind all other objects.
// When I draw text to the screen i disable depth
//testing to draw it on top of everything.
//glDisable( GL_DEPTH_TEST );
glEnable(GL_DEPTH_TEST);
glColor4f(1.0f, 1.0f,0.0f, 1.0f); // yellow glBegin( GL_QUADS );
glVertex2f( 0.0, 0.0 );
glVertex2f( 0.3, 0.0 );
glVertex2f( 0.3, 0.2 );
glVertex2f( 0.0, 0.2 );
glEnd( );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,1000.0f);
glMatrixMode( GL_MODELVIEW );