Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualSaldan

Posted 22 March 2012 - 08:08 AM

If you want to do 6DOF movement using quaternions, do *not* use roll, pitch and yaw. You want to take the user's input and apply small incremental rotations along the three axes to the existing quaternion.

Does that make sense?


Hm... So say the user wants the ship to pitch down a little (relative to the ship's previous orientation, not global orientation).  What confuses me is "apply rotations."  I take that to mean:

1. Create a quaternion qPitch from an axis-angle value where the Axis = {1.0, 0.0, 0.0} and the Angle is, for example, 0.1
2. Multiply qPitch by m_Orientation, the current orientation of the ship, so m_Orientation = qPitch * m_Orientation

Does that sound right?  That has been my intuition up until now, so I assume it's wrong, but I'm not quite sure in what way.

Also, because quaternion multiplications are noncommutative, I've been worried about extending this approach to all three possible axes at once, since the order in which I multiply them will determine the kind of result I get - although I want all rotations to be relative to local axes.  It seems that any order I put them in will shortchange one of the axes or another.

#1Saldan

Posted 22 March 2012 - 08:05 AM

If you want to do 6DOF movement using quaternions, do *not* use roll, pitch and yaw. You want to take the user's input and apply small incremental rotations along the three axes to the existing quaternion.

Does that make sense?


Hm... So say the user wants the ship to pitch down a little (relative to the ship's previous orientation, not global orientation).  What confuses me is "apply rotations."  I take that to mean:

1. Create a quaternion qPitch from an axis-angle value where the Axis = {1.0, 0.0, 0.0} and the Angle is, for example, 0.1
2. Multiply qPitch by m_Orientation, the current orientation of the ship, so m_Orientation = qPitch * m_Orientation

Does that sound right?  That has been my intuition up until now, so I assume it's wrong, but I'm not quite sure in what way.

PARTNERS