Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Get Polygon Coordinates

    SDK Help
    0
    2
    37
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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-

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post