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

    how to compute axis of a polygon?

    Scheduled Pinned Locked Moved SDK Help
    13 Posts 0 Posters 1.2k 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 26/03/2009 at 15:14, xxxxxxxx wrote:

      Howdy,

      I think the way Cinema is doing it is trying to keep the Y axis as close to pointing to world up as possible. To test this, I created a single polygon object, selected the polygon in Polygons mode and used the rotate tool to rotate the selected polygon. That's when I noticed the Y axis of the manipulator trying to point to world up as I rotated the polygon. ;o)

      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 26/03/2009 at 17:49, xxxxxxxx wrote:

        Nope. None of these. I did some tests and the x-axis of the object and the polygon normal are correlated. If you change the object's axis with the Axis tool, the polygon axes change accordingly. So, it seems to be some rotational transform between the object's axis with respect to the polygon's normal (even with axial rotation using the Axis Tool!).

        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 27/03/2009 at 04:36, xxxxxxxx wrote:

          Hi,

          thanks for your input everybody.

          I was actually thinking the same as Cactus Dan, but Robert is right as well. Atm it looks to me as if the poly's y-axis is trying to match its objects y axis closest as possible.. Which would be the combination of all observations 😉

          ill try to compute a vector on the poly with has a minimal angle diff to the objects y axis and see if thats what im looking for.

          greetings,
          Daniel

          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 27/03/2009 at 04:39, xxxxxxxx wrote:

            also i wonder what i'd get if i was to average all edge direction vectors of the poly, or alternatively average only those of opposing edges..

            cannot see it in my head atm, maybe ill just give it a try..

            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 27/03/2009 at 04:40, xxxxxxxx wrote:

              I'll see if I can get some info from the developers on how CINEMA 4D calculates the modeling axis.

              cheers,
              Matthias

              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 27/03/2009 at 05:37, xxxxxxxx wrote:

                that'd be awesome, thanks!

                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 27/03/2009 at 07:55, xxxxxxxx wrote:

                  just had another idea:

                  if i attach a plane which is parallel to the world-ground-plane to the center of the polygon, the intersection
                  between the attached plane and the poly would be my poly- x-Axis i think..

                  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 27/03/2009 at 08:21, xxxxxxxx wrote:

                    .. which would actually mean i only have to compute the cross of the poly normal and (0,1,0) (the ground plane normal)..

                    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 27/03/2009 at 08:38, xxxxxxxx wrote:

                      I don't think the edge vectors play a part. Create a sphere, make it editable, go into Polygon mode, select a polygon, and rotate it (Rotate Tool). Go back to the Move Tool and note that the displayed axes do not change.

                      I agree with the planar idea. Take the X-Y plane* of the object's axis as one plane and the polygon plane as the other. There must be a coordinate system transform from one plane to the other that replicates the C4D polygon axis (no idea how this would work with non-planar polygons though).

                      My first guess would be determing a plane-plane angle to create a rotation matrix (or a plane-plane transform) applied to the axial unit vectors of the object axis. Position is of course simply determined by the polygon's centroid. Time to dig through those 3D math books. 🙂

                      * Sorry about previous references to the X-axis - it is the Z-axis that matches the polygon normal.

                      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 04/04/2009 at 09:35, xxxxxxxx wrote:

                        Hi,

                        just to finish this up (at least from my point of view 😉 ), i did it now the way i described in my last post:

                        Vector polyXAxisDirection = Vector(0,1,0) % polyNormal;

                        This is very simple and gives me just what i need, an xAxis on a polygon, which would never cross the world ground-plane, if it was infinite.

                        I have not verified if this behaves the same as c4d's way of computing the poly-axis, but it fits my purpose exactly.

                        thanks all.
                        Daniel

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