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

    Get/Set HPB ? posible?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 287 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 20/05/2010 at 18:35, xxxxxxxx wrote:

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

      ---------
      I tried not to post until i researched a lot, and I just can't get this to work 😛 ...

      I just want to get or set Rotation values as HPB ,with COFFEE,  like the cinema4D works, i can only set rotation with SetRotation, and in vectors, but i want to use the HPB degrees values , as in the c4d interface.

      Example: i have a cube,  I want to set Rotation 45° to H... or get the H value (45).

      Hope someone can save me from this headache 😛
      Thanks in advance.

      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 21/05/2010 at 06:22, xxxxxxxx wrote:

        The BaseObject GetRotation() function returns a vector containing the object's HPB rotation. That is, the returned vector x component holds the H value, y is P, z is B. SetRotation() works in the same way.

        Try this in the script manager with an object selected:

        main(doc, op)
        {
             op->SetRotation(vector(0.0, 0.5, 0.0));
        }

        This will set the P rotation of the object to 0.5 (note that these functions work with radians, not degrees - 0.5 radians is 28.648 degrees).

        Note also that this only gets/sets local rotations. If you want the global rotation, you'll have to use a matrix. See the excellent tutorial on matrices in the COFFEE SDK.

        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 22/05/2010 at 02:33, xxxxxxxx wrote:

          Side note:

          When dealing with the SDK, you are hopefully aware that all angles are radians, not °... i.e. H is not 45, but π/4 ≈ 0.79.

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