I have an angular velocity vector in three dimensions and a unit quaternion (magnitude of 1) representing an orientation in three dimensions.
I need to apply the angular velocity to the quaternion orientation, such that the rotation is correct in a Newtonian universe.
I'm sure it was in the books somewhere, but now I can't find it.
Alright, in reply to help; would this be the equations?
C is q-1 (well, the conjugate, but my books tell me a unit quaterinion conjugate is the same as the negate)
b is the angular velocity, already scaled by time.
a is q and the quaternion to rotate.
So: qbq-1, or abc for quaternion rotation. It's rotating, that's fine.
However, it's applying the angular velocity as if it were a rotation from (1,0,0,0).
To explain what I'm seeing: Let's say we apply an angular velocity, pre-multiplied by dt (delta time). It gets multiplied by the conjugate of the current rotation (which, currently, is (1,0,0,0) and the current rotation, to result in the next rotation.
So the next rotation is initially equal to the angular velocity.
Then we multiply the angular velocity, as a quaternion, by the conjugate of the current rotation.
Which is the conjugate of the angular velocity as a quaternion.
So essentially, we end up with a rotation from (1, 0, 0, 0) each time step.
...And now it's swinging back and forth along the Y axis.
I suspect the problem is in how I'm turning angular momentum into angular velocity; should I make a new topic? Not entirely sure of informal etiquette here. Makes sense too, but figured I'd ask.