问题
I have a quaternion which holds the rotation of an object. During the frame I modify it and obtain a new quaternion. I can calculate a quaternion that rotates from 'previous frame' to 'current frame'.
I cannot figure out, however, how to 'divide by t' this quaternion to get the rotation-per-second that I need.
I.e, based on the timestep, I need to know what the quaternion would look like had it been applied to itself an X amount of times (meaning, 28.5 times at 28.5 fps, etcetera).
Would anybody know how to do this? Or would you advise me to do something akin converting to Euler, multiplying, and then converting back?
回答1:
Since combining rotations is equivalent to quaternion multiplication, repeating a rotation X times is equivalent to exponentiation: pow(q,X)=pow(q,1/t)
, or exp(ln(q)*X)=exp(ln(q)/t)
. See how to calculate these here.
来源:https://stackoverflow.com/questions/12439109/obtaining-momentum-quaternion-from-two-quaternions-and-timestep