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

    QSlerp() with two Vectors

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 433 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 14/01/2009 at 21:10, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R9-11 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      How exactly would one convert a (direction) Vector into a Quaternion so that one could then use QSlerp() to do an interpolation (between two Vectors) and then retrieve the new Quaternion as a Vector? I know this is more a general mathematics question but I'm having difficulties with RotAxisToMatrix(!(v2%v1), VectorAngle(v2, v1)) trying to do something similar. Quaternions aren't as temporamental but they also aren't easily wedged in and out of Vector maths.

      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 15/01/2009 at 01:36, xxxxxxxx wrote:

        Basically you create a rotation matrix by setting one of the matrix vectors to the direction vector and create perpendicular vectors for the other two matrix vectors. As a direction vector alone is not well defined you have to make a decision which of the matrix vectors you fill with what. Then you initialize the quaternion with the rotation matrix.

        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 15/01/2009 at 10:48, xxxxxxxx wrote:

          Howdy,

          You can also use

          > Quaternion::SetAxis(const Vector& axis, Real wink)

          ... where axis is your vector and wink can be some arbitrary value. As long as wink is the same value for both vectors, you should be able to get the correct slerp. ;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 15/01/2009 at 16:31, xxxxxxxx wrote:

            Ah. Wasn't sure what to do about wink. 😉 🙂

            Thanks, 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 15/01/2009 at 20:41, xxxxxxxx wrote:

              Howdy,

              You're welcome. ;o)

              Adios,
              Cactus Dan

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