PDA

View Full Version : restrict tesselation to single drawing mode



-0x80
01-29-2008, 04:13 PM
Hi,

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?

Cheers,
0x80

http://www.vauxlab.com/tmp/tesselate.png

-NiCo-
01-30-2008, 01: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?

N.

-0x80
01-30-2008, 04: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.

Cheers

Seth Hoffert
01-30-2008, 06: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

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