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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    rotate polygon

    SDK Help
    0
    3
    672
    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 27/11/2002 at 09:48, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.012 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      How can I rotate a polygon? I tried rotate its three (or four) points but I can´t make them rotate in a circle. I tried to add a vector like 0,0,1 and then check if the distance to the midpoint is still the same. And then check the other two (or three) points if they have the same distance to each other so they would rotate around the midpoint too. But it seems to be wrong or I cannot make it. 😞
      (for the first point) :
      vadr[i] += Vector(0,0,1);
      vadr[i] = (distance_to_midpoint/Len(vadr[i]))*vadr[i];
      Anybody know how to correctly rotate a polygon?
      Thanks in advance
      Samir

      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 27/11/2002 at 10:00, xxxxxxxx wrote:

        Use a rotation matrix:

            
            
              Vector center;  
              Vector axis;  
              Real angle;
            
            
            
            
              Matrix rot = MatrixMove(center) *   
                           RotAxisToMatrix(axis, angle) *  
                           !MatrixMove(center);
            
            
            
            
              vadr[i] *= rot;
        

        The above first centers the points around the origin, then rotates them by angle around axis and finally moves them back. All in one accumulated matrix operation.

        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 27/11/2002 at 10:06, xxxxxxxx wrote:

          Upps, that was fast! Thanks very much. I have read this technique in my first book about 3D, the chapters name was "Basic knowledge". 🙂 I guess I gotta go back to the basics. I have to face more Matrix work I guess. 🙂
          Best
          Samir

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