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
    • Register
    • Login

    Converting from HPB to Quaternion

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 505 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 18/12/2004 at 09:52, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.500 
      Platform:    Mac  ;  
      Language(s) :   C.O.F.F.E.E  ;  C++  ;

      ---------
      I've been storing HPB rotations in my file format I export from C4D and load them in to a quaternion to use in game. Now I'm noticing some of the rotations are upside down or translated in the wrong direction (which is probably not related to any rotations going on), so I figured post my code and see if I'm doing anything wrong.

      LVQuaternion::LVQuaternion(float H, float P, float B)
      {
           *this = LVQuaternion(H, 0,1,0) * LVQuaternion(P, 1,0,0) * LVQuaternion(B, 0,0,1);
      }

      Where one of the constructors excepts any angle in degrees and the axis to rotate around.

      Am I doing anything blatently wrong? Is the order wrong?

      Thanks,
      Derek

      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 18/12/2004 at 20:32, xxxxxxxx wrote:

        Howdy,

        Your code looks weird. Is it game engine code or C4D SDK code?

        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 18/12/2004 at 21:06, xxxxxxxx wrote:

          Game engine, sorry.

          (COFFEE for the plugin, C++ for the game)

          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 19/12/2004 at 07:08, xxxxxxxx wrote:

            Howdy,

            The Cinema 4D C++ SDK has a quaternion class. Maybe if you used C++ instead of C.O.F.F.E.E. and converted HPB to quaternion in your plugin first before exporting, you might get better results?

            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 19/12/2004 at 23:11, xxxxxxxx wrote:

              Yea, if only my whole plugin wasn't mostly already written in COFFEE and if I knew the C++ C4D plugin setup I'd give it some serious thought 😕

              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/12/2004 at 10:00, xxxxxxxx wrote:

                Howdy,

                Well, moving from C.O.F.F.E.E. to C++ wasn't really that difficult for me with the help of this tutorial:
                http://www.astrofish.com/tutorials/c4dtagplugin/index.html

                Adios,
                Cactus Dan

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