View Full Version : filled gluCylinder

07-24-2008, 09:52 AM

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 :-(

What do I have to do to get this changed?


07-24-2008, 10:00 AM
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...)

07-24-2008, 01:45 PM
This effect can be acheive by using the stencil buffer. There was a demo @ ati.com that demonstrated this a long time ago.

07-24-2008, 02:39 PM
I have found something interesting about using the stencil buffer here (http://glbook.gamedev.net/moglgp/advclip.asp)

07-24-2008, 03:38 PM
Great folks, thanks!