THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/11/2012 at 01:32, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
I have a question about what the edge index of a selection represents with respect to either a triangular or quadrangular polygon?
"Edges are indexed (4*poly)+edge where edge is from 0-3."
If poly is a triangle and edge 2 is considered, is the edge from poly.c->poly.a or does it always represent poly.c->poly.a? Here is my code. Please help me validate that it is correctly considering the vertex indices represented by each edge:
LONG pi, ei;
for (LONG seg = 0L; bs->GetRange(seg,&a,&b); ++seg)
{
for (i=a; i<=b; ++i)
{
pi = i/4L;
ei = Mod(i,4L);
if (ei == 0L)
{
DetermineAsSourceVertex(verts, normal, polys[pi].a, side, mepsilon);
DetermineAsSourceVertex(verts, normal, polys[pi].b, side, mepsilon);
}
else if (ei == 1L)
{
DetermineAsSourceVertex(verts, normal, polys[pi].b, side, mepsilon);
DetermineAsSourceVertex(verts, normal, polys[pi].c, side, mepsilon);
}
else if (ei == 2L)
{
DetermineAsSourceVertex(verts, normal, polys[pi].c, side, mepsilon);
if (polys[pi].c != polys[pi].d)
DetermineAsSourceVertex(verts, normal, polys[pi].d, side, mepsilon);
else
DetermineAsSourceVertex(verts, normal, polys[pi].a, side, mepsilon);
}
else // ei == 3L
{
DetermineAsSourceVertex(verts, normal, polys[pi].d, side, mepsilon);
DetermineAsSourceVertex(verts, normal, polys[pi].a, side, mepsilon);
}
}
}