A game character is not one rigid lump. A hand is attached to a forearm, the forearm to an upper arm, the arm to a torso, the torso to the world. When the torso turns, the whole arm swings with it — and the hand, dangling at the end of the chain, swings furthest of all. You never want to move the hand by hand. You move the torso, and the engine carries everything downstream for free. That bookkeeping is the scene graph: a tree of objects, each one parented to the one above it.
The trick is that every node stores its transform relative to its parent, not relative to the world. The hand knows only "I sit a little out along the forearm"; it has no idea where it is in the level. Turning that humble local fact into a world position is the one computation a scene graph exists to do.
Give each node two transforms. Its local transform
Step 1 — the root is its own world. The root node has no parent, so its local frame is the world frame. Nothing to compose:
Step 2 — a child sits in its parent's frame. The torso's local transform
Step 3 — recurse down one more link. The arm hangs off the torso, so the identical argument with the torso playing the role of parent gives:
Step 4 — read off the general rule. Nothing in Steps 2–3 depended on the
names; every node obeys the same one-line recurrence. For any node with parent
Step 5 — unroll it into a chain. Substitute each parent's world matrix back in, all the way to the root. The hand's world transform is the product of every local transform from the root down to the hand:
Step 6 — push a vertex through. A vertex authored in the hand's local space
(the modelling frame the artist drew it in) becomes a world vertex by multiplying through that
same chain — local
And here is the payoff hiding in Step 4: change one parent's transform and every
Three nodes, parented in a line: tank body
recomputed every frame from whatever the body and turret are currently doing. The very same
pattern is a humanoid skeleton: pelvis
A two-link rig: a parent arm pinned at the origin, and a child
hand pinned to the far end of the arm with its own local offset and spin. Drag the
parent rotation slider — you are editing only