Sign in to follow this  
jimmy1

SLERP question?

Recommended Posts

jimmy1    130
I have 2 questions regarding slerp 1) When slerping between 2 quaternions, q1 and q2, the angle between them is cos(theta) = q1(Dot)q2. This may be a simple question, but does anyone know where this formula is coming from? 2) One formula for slerp is q1(q1^-1,q2)^t. Can anyone please explain how this formula is derived? Thanks in advance!!

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
One formula for slerp is q1(q1^-1,q2)^t. Can anyone please explain how this formula is derived?
I think you mean for the terms in parentheses to be multiplied, rather than separated by a comma, correct?

In any case, let's say you have two scalars, a and b, and you want to interpolate between them. One way to do it is to find the difference from a to b, and then add a fraction of that difference to a, like this:

a + (b - a)t

Similar constructs exist for matrices and quaternions. We just have to figure out what we mean by 'difference' and 'fraction of' for each.

For two orientations, the 'difference' between them is an axis-angle rotation which rotates from the first orientation to the second. With both matrices and quaternions this rotation can be solved for using inversion. So in your formula, the (q1^-1*q2) term is the 'difference' between q1 and q2, and corresponds to (b - a) in our linear example.

Furthermore, we combine quaternion rotations by multiplication rather than addition, and we get a 'fraction' of a quaternion by taking it to a power rather than scaling its components linearly.

So now we can write the two equations together:

a + (b - a)t

q1*(q1^-1*q2)^t

And you can see that it's the same general concept.

Now I'm no mathematician, and there are others on this board who will be able to give you a much more rigorous explanation. But maybe the above will be helpful to you as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this