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

    Issue setting rotation

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 427 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/06/2009 at 16:03, xxxxxxxx wrote:

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

      ---------
      All of a sudden i cant set the angle properly:

      > `

        
      \>                                     GeData data;  
      \>                                     obj->GetParameter(DescID(ID_BASEOBJECT_SCALE), data, 0L);  
      \>                                     obj->SetParameter(DescID(ID_BASEOBJECT_SCALE), GeData(data.GetVector()*_resize), 0L);  
      \>                                     obj->SetParameter(DescID(ID_BASEOBJECT_ROTATION), GeData(Vector(45,0,-45)), 0L);  
      \>  
      

      `

      but the result in cinema is
      2578.31 °
      0
      -2578.31 °

      Whats that ?? I guess i just didnt notice that i am doing something wrong because i did a random plugin and thus didnt check the values as it looked ok to me...

      is there a solution somewhere? why cant i set the same values via script that i can set inside cinema via the gui??

      thanks for your help,
      ello
      thanks for your patience 🙂

      cheers,
      ello

      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/06/2009 at 16:50, xxxxxxxx wrote:

        Simple: All rotations are in Radians, not degrees.

        I use these inline converters when the angles are variable:

        inline Real ToRad(Real r) { return ((r)*0.017453292519943295769236907684886f); }
        inline Real ToDeg(Real r) { return ((r)*57.295779513082320876798154814105f); }

        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/06/2009 at 00:55, xxxxxxxx wrote:

          thank you very much, it works but wow, where do those numbers come from?

          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/06/2009 at 10:39, xxxxxxxx wrote:

            PI/180 and 180/PI. Instead of doing the floating point math over and over (even inline), I simply put in constants. More precision than ever needed and beyond that of a 32-bit IEEE floating point encoding but I simply copy-pasted the values from the Windows Calculator. 🙂

            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/06/2009 at 13:29, xxxxxxxx wrote:

              it works totally cool.

              i must generally thank you and all others here in this forum for all the help i find here. i hope someday i can return something

              cheers,
              ello

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