View Full Version : restrict tesselation to single drawing mode

01-29-2008, 03:13 PM

I'm using the GLUT to tesselate the contour of a human body and draw it as a solid shape. Everything is fine if I draw directly from the tesselation algorithm, like the picture below.

I need to store the vertices into an array and draw the whole array with a SINGLE draw mode. The problem is, the tesselation algorithm breaks up the shape into various sections and uses different drawing modes for each, like triangles, triangle_fan etc.

How can I get this output to work if I'm limited to only one single drawing mode, say just triangles? Is there a way to force the algorithm to be consistent?



01-30-2008, 12:01 AM
If you have direct access to the tesselated vertex/index data, converting triangle fans and triangle strips to plain triangles should be straightforward, no?


01-30-2008, 03:51 AM
Thanks for the tip Nico. Somehow I assumed that would be a tricky thing to do. Now that I think about it I guess you're right. I'll try to manually generate an index array for the vertices that I get from the tesselation, so they can be drawn as triangles only.


Seth Hoffert
01-30-2008, 05:26 AM
This can be done by registering an empty callback for GLU_TESS_EDGE_FLAG.

See http://www.geocities.com/foetsch/extrude/extrude.htm#edgeflag

01-30-2008, 05:39 AM
BRILLIANT!! That's what I was hoping for=) Thanks a lot!