Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Determine the selection point and the normals

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 251 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 02/02/2011 at 02:25, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:    Mac  ;  
      Language(s) :     C++  ;   PYTHON  ;

      ---------
      Hi,
      I am new in the plug-in development for cinema 4d. Before I want to write a specific tool plug-in I tried some general stuff. One problem I faced is to determine the correct selection point of a selected polygon or a number of polygons. It should be the same coordinate like is the origin of the three arrows that are shown when the selection tool is active.
      The second problem is to determine the correct normal vector of a selected polygon also if the points of that polygon are not coplanar.

      Thanks,
      Karsten

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 02/02/2011 at 03:00, xxxxxxxx wrote:

        The "three arrows" normally show the modeling axis, which can be set in various ways in the app (Attribute Manager -> Tool -> Modeling Axis). The way to access it is:

          
        BaseObject* objcenter = doc->GetRealActiveObject(NULL, NULL);   
        if (objcenter != NULL)   
        {   
        Matrix centermat = objcenter->GetModelingAxis(doc);   
        // centermat is your "three arrows" coordinate system   
        }                  
        

        As for the normal of a non-coplanar polygon: mathematically, there is none. C4D uses the first three points of a polygon to determine the normal (at least according to the normal line that is drawn in the viewport) and ignores the last. As for N-gons... I do not have the slightest clue, the line just points somewhere!

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