Archived

This topic is now archived and is closed to further replies.

whats causing this?

This topic is 5149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an app (below) that im developing, but im noticing some strange behavior when rendering. The bottom three windows display triangles that are behind others in 3d space in front, or in other words, things in the background are rendered in front of things in the foreground. In the screen shot, everything except the white dot is rendered with glEnable( GL_CULL_FACE ); and when the dots are rendered, i disable GL_CULL_FACE. The dots are rendered with code like this: glDisable( GL_CULL_FACE ); glPushMatrix(); glTranslatef( v0.x, v0.y, v0.z ); gluSphere( m_pQuadricObj, 0.1f, 16, 16 ); glPopMatrix(); glEnable( GL_CULL_FACE ); As you may see, the dots in the top view at #1 are rendered correctly, in that they are visiable from anywhere, but in #2-5 they are obscured where thry shouldnt be. Any ideas of whats going on?

Share this post


Link to post
Share on other sites
It looks like you have the face culling messed up, so it''s culling the front faces instead of the back.

glCullFace() should be set with GL_BACK if at all.
glFrontFace() should be set with GL_CCW (if at all).

Share this post


Link to post
Share on other sites
quote:
Original post by OrangyTang
Whats your depth testing state look like when doing the dots? Are you sure its enabled and working properly?


humm, well i placed a call to glEnable( GL_DEPTH_TEST ); directly before rendering each view and it works correctly now. This seems starnge, because when initalizing opengl, i already call it. Does anything disable glEnable( GL_DEPTH_TEST ) ?

[edited by - Mulligan on November 9, 2003 6:59:34 PM]

Share this post


Link to post
Share on other sites