filled gluCylinder


I am using

gluQuadricDrawStyle(pQuadObj, GLU_FILL);

with the intent of filling the inside volume of a cylinder, such that if I use clip planes through it, I see a solid cut plane.

But I do only see the outline :frowning:

What do I have to do to get this changed?


GLU_FILL is just about filling polygons not the inside of the volume.


I think this is possible to obtain this effect using a shader. I have never tried this, but I am thinking that you may give the clipping plane equation to the shader and determine in a fragment shader if a fragment is on top or underneath the plane. In the first case you do all lighting calculations as if you were on the plane (using plane normal, etc…)

This effect can be acheive by using the stencil buffer. There was a demo @ that demonstrated this a long time ago.

I have found something interesting about using the stencil buffer here

Great folks, thanks!