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

    Points to plane

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 521 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 12/05/2011 at 16:52, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12&11.5 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi all !

      I'm trying to orient an object in the same direction than a plane generated by 3 selected points ...

      I have my 3 points and their coordinates, but I can't find what I should calculate to make them a reference plane with a correctly oriented axis.

      Thanks for all suggestions...

      Mike

      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 12/05/2011 at 19:52, xxxxxxxx wrote:

        Three points are all you need to define a plane (p1, p2, p3).  Select one point as an arbitrary 'origin' (p1) and the other two become the other ends of direction vectors that also contain that point (p2-p1 and p3-p1).  So, you have to vectors which define the plane.  From there you can determine a normal on the plane (perpendicular to the planar surface) using a cross product ((p3-p1) x (p2-p1) = normal).  If you normalize all the vectors (make them to be within a length of 1.0) and orthonormalize them (make them mutually perpendicular) you will have the correctly oriented axis of the plane.

        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 13/05/2011 at 00:43, xxxxxxxx wrote:

          Ok, and then how can I orient my other object like this plane ?

          Thank you

          Mike

          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 13/05/2011 at 06:48, xxxxxxxx wrote:

            Ok now my axis is correctly placed and orientated, but it's sheared... When I do a reset system on it becomes ok.

            How can I reset it in my script ?  (I would like to avoid using CallCommand)

            Thanks

            Mike

            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 13/05/2011 at 07:24, xxxxxxxx wrote:

              Howdy,

              Use the cross product to square up your matrix starting with your plane's normal vector.

              So, for example if your plane's normal vector is the Y axis, then you use either:
              XAxis cross YAxis = ZAxis;
              YAxis cross ZAxis = XAxis;
              ZAxis cross XAxis = YAxis;
              or
              YAxis cross ZAxis = XAxis;
              XAxis cross YAxis = ZAxis;
              ZAxis cross XAxis = YAxis;

              Adios,
              Cactus Dan

              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 13/05/2011 at 07:36, xxxxxxxx wrote:

                Thanks I'll try tonight !

                Mike

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