depth
Hi
i have a scene where the object closest to the viewer gets at certain angles objects appear to disappear also obscure the view of other objects when they should not - i.e they are draw in front of or behind other objects when it should be the opposite also the also disappear at certain angles
I have the following in my initOGL()
glShadeModel(GL_SMOOTH);
glCullFace (GL_BACK);
glEnable( GL_DEPTH_TEST ); // Enables Depth Testing
glEnable (GL_LINE_SMOOTH);//makes grids on floor look smooth
glEnable (GL_POLYGON_SMOOTH);
glEnable (GL_CULL_FACE);
and in onPaint() i have
glDepthFunc(GL_EQUAL); // The Type Of Depth Testing To Do
glClearDepth( 1.0f ); // Set Depth Buffer to Max Dist. when cleared
glClearColor( 0.0f,0.0f,0.0f,0.0f ); // Black Background
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
any ideas?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement