I've been doing graphics programming stuff for quite some time now and surprisingly never had to deal with animations much. Now I needed to blend more than two transforms (each transform is represented by position vector3 and roation quaternion). With two transforms it's easy. You do lerp for the translation and slerp to the rotation, providing "blend progress" parameter. Now how do I do the same for more than two transforms? For tanslation it's easy and intuitive - just do lerp of more than two translation vectors, whose weights sum up to 1. Check. Now the rotations... So how do I slerp more than two transforms? I searched the web and turns out it's not that simple problem. So I asked a fellow animation programmer and to my surprise he told me I got it all wrong. Slerping two rotations is not the same as blending them, he told me. Instead of slerping rotations I should do this:
Quaternion q1 = Quaternion.Slerp(Quaternion.identity, rotation1, weight1);
Quaternion q2 = Quaternion.Slerp(Quaternion.identity, rotation2, weight2);
Quaternion blendedQ = q1 * q2;
And when I need more rotations I just add more identity-to-rotation slerps and compose them with the total blended quaternion. Now that is easy and seems pretty intuitive. We just rotate by (weightN of rotationN) for each N.
So eventually I tried googling for rotations blending or animation blending, expecting many people askng this question and getting similar answer to the one I was given by my friend. But turns out it's rather hard to find this solution. Is this because that solution is so obvious and nobody ask about it or do you guys have some different ways for blending rotations?