On 05/03/2015 at 12:22, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14,15,16
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I am using this code to get the polygon index that every vertex belongs to, but it's very slow.
Is there a faster way to do it?
const CPolygon *pPolys = pobj->GetPolygonR();
for (int i = 0; i<pointCnt; i++)
{
for (int j=0; j<polyCnt; j++)
{
if (pPolys[j].a == i)
myIndexArray[i] = j; // myIndexArray is an integer BaseArray that is storing the polygon indices
}
}
Since I am manually going over every vertex and from it check every polygon, the operation is very slow. I am hoping someone can give a faster alternative.
Thanks