Transform composition is the foundation of how animations work in 3D engines. Understanding this concept is essential for implementing any animation system.
The core principle: Animation data in GLTF describes changes (deltas), not absolute positions. When an artist animates a ceiling fan spinning in Blender, they’re defining how much it rotates over time, not where it should be in world space.
Consider a ceiling fan at position (10, 5, 8) with an animation that rotates it. The animation keyframes might specify:
* Translation: (0, 0, 0) — no movement
* Rotation: 0° → 360° around the Y axis — spinning
* Scale: (1, 1, 1) — no scaling
To display this correctly, we must compose the animation delta with the object’s base transform:
-
Base transform: The object’s initial position/rotation/scale from the scene hierarchy
-
Animation transform: The time-varying delta from the keyframes
-
Final transform: Base composed with Animation
The composition rules are:
* Translation: final = base + animDelta (addition)
* Rotation: final = base * animDelta (quaternion multiplication)
* Scale: final = base * animDelta (component-wise multiplication)
With proper composition, our ceiling fan remains at (10, 5, 8) and spins in place.