After some experiment based on what you say about the winding, I figure the problem, and now I have the correct behavior. But that still doesn't explain why GL_CULL_FACE is doing something, when using GL_LINE.


Le 05/15/10 21:52, Roland Everaert a écrit :
So how to explain that a spinning cube gives me what I want (the verteces not seen by the camera are hidden)?

The code is the same, but where GL_TRIANGLES is replaced by GL_QUADS, the vertices and indices lists are filled accordingly and the 2nd argument of glDrawElements replaced by the len of the indices list. And there is no test on the depth.



Le 05/14/10 23:36, Ian Mallett a écrit :
Well, for one thing, you're drawing the tetrahedron in line mode.  GL_CULL_FACE does nothing for GL_LINE. 

You might also try culling the front faces glCullFace(GL_FRONT).  If the results are expected, then reverse the winding order of the polygons (i.e., polygon [v1,v2,v3] specify as [v1,v3,v2]) and cull the back as before.