Skeletal animation: What is the purpose of multiplying interpolated bone matrix with parent's matrix? Let's say I have the following hierarchy:

Bone A
    Bone B
        Bone C


Here's how most tutorial is telling me how to calculate the finalMatrix to be sent to shader.

bonePoseToWorldPose(Joint * joint, glm::mat4 &amp; parentTransform, glm::mat4 &amp; globalInverseTransform) {
    joint-&gt;finalTransform = parentTransform * joint-&gt;localTransform; // local transform is the result of interpolating 2 keyframes
    for (int i = 0; i &lt; joint-&gt;children.size(); i++) {
        bonePoseToWorldPose(joint-&gt;children[i], joint-&gt;finalTransform, globalInverseTransform);
    }
    joint-&gt;finalTransform = joint-&gt;finalTransform * joint-&gt;inverseBindTransform;  
}


Doing it this way, the final transform in bone C for example, would be localTransformA * localTransformB * localTransformC * jointInverseBindTransform.

Which does not make sense to me, and none of the tutorial satisfactorily explains that. Let's go back to the example again. the inverse bind transform would bring a vertex V from mesh space to bone space of Bone C. At bone space C, it would be multiplied with the localTransformC (or interpolated transform C), which I guess would set the model to our desired pose. But what are A and B doing there?
The bone transforms are relative to their parent in the hierarchy. That's the point of the hierarchy, i.e. when you move your arm, your hand and fingers go along with it. So when an animation (or whatever) changes the transform of A, then bones B and C are supposed to move along with it.

This is accomplished by defining bone B relative to A, and C relative to B, and so on.

Therefore, to get the final transform from bone local space to world space, you have to combine all the transforms from the current bone up the hierarchy to the root.

To put it another way:


The localTransform of C takes you to B's local space.
Then the localTransform of B takes you to A's local space.
Then the localTransform of A takes you to world space (since A is the root).