speps / LibTessDotNet

C# port of the famous GLU Tessellator - prebuilt binaries now available in "releases" tab

Home Page:https://www.nuget.org/packages/LibTessDotNet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BoundaryContours didn't work properly

lapilesos opened this issue · comments

Hi.

Seems like BoundaryContours didn't work properly.
`
// [0]: {90, 220, 0, Color [Azure]}
// [1]: {290, 220, 0, Color [Azure]}
// [2]: {290, 20, 0, Color [Azure]}
// [3]: {90, 20, 0, Color [Azure]}

tesselator.Tessellate(WindingRule.EvenOdd, ElementType.BoundaryContours,1, VertexCombine);
Returns:
tesselator.Vertices
{Tesselator.ContourVertex[4]}
[0]: {290, 220, 0, Color [Azure]}
[1]: {90, 220, 0, Color [Azure]}
[2]: {90, 20, 0, Color [Azure]}
[3]: {290, 20, 0, Color [Azure]}

tesselator.Elements
{int[2]}
[0]: 0
[1]: 4
Aren't Elements wrong? BY my assumptions there should be :
{int[4]}
[0]: 0
[1]: 1
[2]: 2
[3]: 3
`
WBR,
Andrew

I'll have a look very soon. Thanks for the report :)

Right, it does work but the list of elements is actually a list of ranges [startIndex, vertexCount]. One for each face. So in your case, you have one face which starts with 0 and has 4 vertices.

I added a note in 6f3f388.