Dear Experts,
triangle is not drawn when glOrtho z range between 0 and 1.
glMatrixMode( GL_PROEJCTION );
glLoadIdendity();
glOrtho( -1,1,-1,1,-1,1 );
glMatrixMode( GL_MODELVIEW );
glLoadIdendity();
// Draw a triagnle in z -0.5
glBegin( GL_TRIANGLES );
glColor3f( 1, 0, 0 );
glVertex3f( -0.5, -0.5, 0.5 );
glVertex3f( 0.5, -0.5, 0.5 );
glVertex3f( 0.0, 0.5, 0.5 );
glEnd();
It displays a red triangle. Its fine for me.
But when I change near clipping plane to 0, It displays nothing.
Traingle is drawing with z 0.5, and near and far is between 0 and 1.
But Traingle is not drawn why ?
Please give any information…
Thanks in advance…
glMatrixMode( GL_PROEJCTION );
glLoadIdendity();
glOrtho( -1,1,-1,1,0,1 );
glMatrixMode( GL_MODELVIEW );
glLoadIdendity();
// Draw a triagnle in z -0.5
glBegin( GL_TRIANGLES );
glColor3f( 1, 0, 0 );
glVertex3f( -0.5, -0.5, 0.5 );
glColor3f( 0, 1, 0 );
glVertex3f( 0.5, -0.5, 0.5 );
glColor3f( 0, 0, 1 );
glVertex3f( 0.0, 0.5, 0.5 );
glEnd();