Get Polygon Coordinates
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/12/2005 at 20:05, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.521
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;---------
Currently I can find all the polygons that make up a sphere, but I would like to access each of the polygons coordinates. I know there is something very simple that I am over looking and would appreciate any help I could get. Here's the code I have so far:var obj = doc->FindObject("Sphere"); var pcnt = obj->GetPolygonCount(); var pArray = obj->GetPolygons(); var polyNum, poly; var i; for(i = 0; i<=pcnt; i++) { polyNum = pArray[i]; poly = obj->GetPolygon(polyNum); }
So the question is: What do I have to do to the variable poly in order to access it coordinates? Thanks in advance
-Josh- -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/12/2005 at 00:59, xxxxxxxx wrote:
Each polygon contains a set of vertex indices (a,b,c,d) that index into the point array of the object. These contain the (x,y,z) coordinates for which you are looking. Be aware that the points represent untransformed vertices. You will need to apply either the matrix from GetMg() or GetMl() to get the global or local point tranforms, respectively.
So, if you want to 'access the polygons coordinates' irrespective of polygons, you can just go directly to the points (GetPoint() and GetPointCount()) to access the coordinates.