[Bf-committers] Quaternion interpolation is bumpy/wrong

Nathan Vegdahl cessen at cessen.com
Wed Apr 25 22:21:13 CEST 2012


> What i expected was a smooth motion, but
> instead it goes straight up (to 2nd key) and continues with a curve that
> _bends downward_ to key 3.  Given that it has to move trough the keys i
> would have at least expected a "linear" motion (shortest path) from key
> 2 to key 3.

The interpolation is not incorrect (insofar as interpolation can be
"incorrect").  If you were doing linear, shortest-path interpolation,
it _would_ be bending downward.  Your main misunderstanding is that
you are mistakenly thinking of the direction that the leg is pointing
as the only relevant aspect of rotation.  But that is not correct.
The twist of the leg is also part of the rotation, and you are
introducing a 90 degree twist with the second rotation.

Take a look here:  http://www.pasteall.org/blend/13542
I've added "axis" bones to make it more obvious what's going on.  The
setup on the left is your animation, and the setup on the right has
been changed so that it's not twisting.

Here's another file to take a look at:  http://www.pasteall.org/blend/13543
It's the same as the one I linked above, except with linear
interpolation (e.g. "shortest path").  It should be more visually
obvious in this why you're getting the "rotate down" effect.

--Nathan


On Tue, Apr 24, 2012 at 3:12 AM, Tobias Oelgarte
<tobias.oelgarte at googlemail.com> wrote:
> I don't know if this is a known issue. But i tried the following. I made
> a key for a leg (restpose),  bended it forward (xrot 90°, second key)
> and moved it to the side (zrot 90°, third key), and then added a fourth
> key (restposition again). What i expected was a smooth motion, but
> instead it goes straight up (to 2nd key) and continues with a curve that
> _bends downward_ to key 3. Given that it has to move trough the keys i
> would have at least expected a "linear" motion (shortest path) from key
> 2 to key 3.
>
> The reason for that is the interpolation (bezier curves) between the
> keys. It interpolates every component as a single key. But that isn't
> right for quaternion rotation. Instead it should interpolate between the
> quaternions (at the keys) itself using a slope function to define how
> the interpolation in between keyframes behaves.
>
> I uploaded an example to pasteall.org to illustrate the issue:
> http://www.pasteall.org/blend/13505
>
> The left armature (named "wrong") shows what i mean with wrong
> interpolation and the right armature shows how it should look like
> (named "nearly right", because it is impossible to get it right at the
> moment).
>
> Maybe someone has the time to look at the example and to figure out a
> way how it could be correctly implemented. My attempt would be to remove
> the possibility to edit f-curves for quaternions (who does that anyway?)
> and to use another interpolation scheme for this kind of rotations.
>
> Greetings from
> Tobias Oelgarte
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list