Pose Modification

Pose modification is a broad topic, it means modifying the Pose that is returned by sampling a clip before using it to skin a mesh. Blending animations together and inverse kinematics are both examples of Pose Modification. Both animation blending and IK are covered in the book.

Animation blending is commonly used to prevents hard transitions between aniamtions, it is an interpolation function, it will interpolate from one pose to another given some scalar value t. Transforms are made up of vectors and quaternions, if we interpolate those we can interpolate between two poses. The code below demonstrates this:

void Blend(Pose& out, const Pose& a, const Pose& b, float t) {
    for (int i = 0; i < a.size(); ++i) {
        out.position = lerp(a.position, b.position, t);
        quat b_rotation = b.rotation;
        if (dot(a.rotation, b.rotation) < 0) {
            b_rotation *= -1.0f;
        }
        out.rotation = nlerp(a.rotation, b_rotation, t);
        out.scale = lerp(a.scale, b.scale, t);
    }
}

The dot product check is in place to make sure the quaternions being interpoalted are in the right neighborhood.