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

    MatrixToHPB Not Giving the Global Rotation?

    Cinema 4D SDK
    r25 python
    4
    3
    355
    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.
    • B
      bentraje
      last edited by

      Hi,

      Based on the forums, the way to get the Global Rotation is
      c4d.Utils.MatrixtoHPB(op.GetMg())

      But it somehow gives different values. In the image below, the local rotation should also be the global since there is no parent.

      But as you can see, it does maatch the figure in the console.

      Is there a way around this?

      615566ab-0393-47fc-8456-22d3d2e8840c-image.png

      1 Reply Last reply Reply Quote 0
      • B
        bentraje
        last edited by

        Aw.
        My bad. It is on radians. I have to ran this command.
        c4d.utils.RadToDeg()

        Nothing to see here folks lol

        ferdinandF 1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand @bentraje
          last edited by ferdinand

          Hello @bentraje,

          thank you for reaching out to us. There is nothing much left to add for us here. All angle values are represented internally in radians in Cinema 4D, only the UI does convert to degrees. Except for displaying angle values in UIs, I would however recommend to embrace the unit of radians in code rather than converting in and out of it.

          There is no computional downside to always doing the conversions, e.g., theta: float = c4d.utils.DegToRad(90). But writing something like theta: float = math.pi * .5 forces oneself to understand the intimate relation between a trigangle and the unit circle, i.e., the circle or trigonometric functions. Understanding radians and why it is a useful unit is then an emergent property of that understanding of trigonometry.

          Cheers,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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