Texture mapped surface shows through surfaces in front of it

as I rotate the scene my texture mapped polygon should be hidden, other times it is hidden correctly. Maybe hidden surface removal is not working, but, I have used glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); before drawing, and glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH); and glEnable(GL_DEPTH_TEST); in main().
How do I fix this?
Greatly appreciate any help.

(I am drawing a GL_QUAD, a cube with four faces, without top and bottom. One of the faces is texture mapped. So when rotating the other faces of this quad should cover that face, now showing the reverse side of the texture image, but that reversed texture image should not be showing through, ie there is a face infront of it.)

That the Z buffer should not work is certainly not likely. Perhaps some blending error? Try to remove GLUT_ALPHA and disable all blending.

i think this is due to that:
Just take care how you draw your faces. just let have the same clock counter wise ! if they are not correct, some faces may not have correct culling. You may cull the back faces too.
(i may have misunderstood the question, so appologies me)

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.