memononen / libtess2

Game and tools oriented refactored version of GLU tesselator.
Other
465 stars 98 forks source link

Is there a way to mark which triangle edges are polygon edges? #20

Closed nmr8acme closed 9 years ago

nmr8acme commented 9 years ago

Some output polygon edges are interior to a tessellated polygon, and some are exterior to it (i.e. edges of the tessellated poly.) Is there any way to get this information out of libtess2?

E.g. if I tessellate a quad with triangles, two edges of each output triangle will be "exterior edges", and one edge of each output triangle will be an "interior edge."

I'd like to know which are which so I can draw tessellated polygon outlines in the same pass that I draw the fills. (I.e. via this technique: http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/) So I need to know which edges not to draw for that to work.

memononen commented 9 years ago

Yes, it is possible. Take a look at connected polygons output option: https://github.com/memononen/libtess2/blob/master/Include/tesselator.h#L68

--mikko

nmr8acme commented 9 years ago

Perfect! Thanks Mikko!