[Bf-committers] Quaternion interpolation is bumpy/wrong

Bartek Skorupa bartekskorupa at bartekskorupa.com
Thu Apr 26 08:12:13 CEST 2012


The issue is not "bad" blender's behavior but difficulties with  
understanding what is going on when certain rotation models are used.
When animating rotations we often use our intuition and expect some  
behavior because we know our particular case.
Algorithms don't know exactly what our goal is. They have to be  
universal.
All algorithms have their flows.
I'd strongly vote not to mess up with the rotation interpolation as it  
is correct and we can do nothing about it.
We have 2 main rotation models: Euler and Quaternions.
Quaternions will interpolate exactly as shown in the example and we  
the humans intuitively perceive it as "wrong", but it's not.
In every single case we have to choose proper model, but can't change  
the model itself.
Every single model (and in fact we have 7 main choices) will fail in  
some scenarios.
We simply have to choose the one that has least chance of failure in  
our particular case.
In our scenario Quaternions fail, so we have to use one of the 6  
available Euler models (6 possible rotations orders) or some smart  
parenting structure.
The first thought that came to my mind when I saw the example was:  
"Something is broken. Quaternions shouldn't work this way", but then I  
analyzed this and figured out that there's nothing wrong with it.
I tested the same scenario using another app. I used quaternions model  
there and behavior was exactly as in Blender, so there's nothing wrong  
with Blender.

F-curves for quaternions:
I don't know anybody who use individual animation curves when working  
with quaternions, but this doesn't mean that there's no one doing it.  
I simply didn't have a chance to meet such person.
However I've heard some day that at least few people on the face of  
this earth CAN do it.
Therefore I wouldn't get rid of the curves.
Normal human beings will not use them, but let's leave them for other  
species :-)

Cheers

Bartek Skorupa

www.bartekskorupa.com


On 2012-04-26, at 03:36, Bassam Kurdali wrote:

Rotations in 3D are just a horrible beast, and I think it is non trivial
to figure out what constitutes a 'nice' interpolation across all cases,
perhaps not even possible. You might be to use hierachies to isolate
axis for some very specific setups, however:
>>> 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?)
Lots and lots of animators edit quat f-curves- and wouldn't like 'taking
the curve editor away' unless it is replaced with something better...
(curve editor++ ? direct editing of paths/handles in the 3D view?)
>>> and to use another interpolation scheme for this kind of rotations.
>>>
euler will have it's own, worse interpolation issues, but I'm not sure
how axis angle would behave in this specific case. Does anyone actually
use axis-angle and it's just me living in the stone age?

On 2012-04-26, at 03:19, Nathan Vegdahl wrote:

>> But I think that this is not really the kind of
>> interpolation an animator would want to have
>> in this case.  As an animator I would prefer
>> a direction interpolation and a separate "roll"
>> interpolation.
>
> Believe me, as an animator and rigger, I have thought about this
> problem a lot.  But it's not as simple as you make it out to be.
> Whenever you separate out axes of rotation like that, you introduce
> singularities.  So you could, for example, use euler rotation with an
> appropriate rotation order to accomplish what you want here, but then
> it will interpolate strangely in other circumstances.
>
> For example, in this file: http://www.pasteall.org/blend/13547
>> From key-1 to key-2, and from key-2 to key-3, the interpolation
> behaves as you expect.  But from key-3 to key-4 it behaves strangely.
>
> Even if we hide the interpolation curves entirely and let Blender do
> whatever strange things it wants to accomplish various interpolation
> methods internally, it's not clear to me that there's an obvious way
> to accomplish what you want in the general case, because "roll" is
> actually ill-defined for fully general 3d rotations.  Besides which,
> if we do that, then we deprive animators of a lot of control via
> interpolation curves.
>
> You might be able to accomplish something close to what you want via
> some clever rigging, however, by having separate controls for the
> pointing direction and the roll.  But you have to choose what
> "pointing without rolling" means then, which involves making some
> limiting assumptions.
>
> In any case, there is nothing broken about how Blender is
> interpolating your key frames.  I agree it's crappy for this use-case,
> but I don't know of any existing methods that are less crappy.
>
> --Nathan
>
>
> On Wed, Apr 25, 2012 at 1:57 PM, Tobias Oelgarte
> <tobias.oelgarte at googlemail.com> wrote:
>> Yes, you're right. But I think that this is not really the kind of
>> interpolation an animator would want to have in this case. As an
>> animator I would prefer a direction interpolation and a separate  
>> "roll"
>> interpolation. Ideally both rotations (as in your example files)  
>> would
>> follow the same path on the rotation sphere, while only the roll  
>> behaves
>> differently. Otherwise such movement will have this up/down curve,  
>> which
>> isn't nice to look at.
>>
>> Greetings from
>> Tobias Oelgarte
>>
>> Am 25.04.2012 22:21, schrieb Nathan Vegdahl:
>>>> 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
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> 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