Let's say I have two rotations, A(t) and B(t) that vary over time t. B(t) happens to be an extrapolation of an original rotation so B(t) = B(0) + t * dBdt, where dBdt is the original/constant rate of change of B.
What I want to calculate is a slerp between A and B:
Result(t) = slerp(A(t), B(t), T)
for T increasing from 0 and 1 (i.e. T = someConstant * t).
However, if A and B are represented by quaternions, then even if they start off in the same hemisphere, then after a while the direction of the slerp can (does!) flip, making the result discontinuous. In fact, if dBdt is big enough then B(t) needs to actually represent a rotation that is multiple complete revolutions. Quaternions obviously don't manage this.
Can anyone suggest a solution to this (e.g. involving intermediate representation using rotation vectors)?
One improvement would/might be to add on a fraction of the extrapolation after the slerp:
C(t) = slerp(A(t), B(0), T)
result(t) = C(t) + (1 - T) * t * dBdt
So long as A(t) and B(0) don't diverge much, then this should make result continuous, though it wouldn't be a "proper" large-angle slerp. I just wonder if anyone has a better idea :)
MrRowlMember Since 01 Jan 2004
Offline Last Active Today, 10:12 AM
- Group Crossbones+
- Active Posts 795
- Profile Views 6,894
- Submitted Links 0
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
- Website URL http://www.rowlhouse.co.uk