PDA

View Full Version : filled gluCylinder



umugl
07-24-2008, 09:52 AM
Hello,

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?

Thanks!

dletozeun
07-24-2008, 10:00 AM
GLU_FILL is just about filling polygons not the inside of the volume.

EDIT:

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...)

V-man
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.

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

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