Is there a way in OpenGL to render only interior faces while exterior faces still cover/occlude the interior ones? To better understand what I want to accomplish, if I would slice a randomly positioned cylinder, I would see only an ellipse.
I have tried:
glEnable(GL_CULL_FACE);
glEnable(GL_BACK);
But in this case I see the whole interior of the cylinder, while the exterior faces just dissappear without covering anything.
Thanks
GL_BACK
can't be "enabled". The culled faces are selected byglCullFace
:glEnable(GL_BACK);
Note,
glEnable(GL_BACK)
will cause anINVALID_ENUM
error.Face culling depends on the winding order. See also Face Culling.
e.g. If your faces are clockwise and you want to cull the back faces, then you have to:
Note, it is important, that all the faces have the same winding order (clockwise or counter clockwise).