質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top