Debugging Pivot Offsets, Non-Uniform Parent Scales, and Scene Graph Nesting
How Column-Major 4×4 World Matrices Accumulate Across glTF Nodes
In glTF 2.0, every node in nodes[] defines its local coordinate frame either as a 16-element column-major matrix or as decomposed translation, unit quaternion rotation, and scale (TRS) vectors: M_local = T × R × S. A child node’s world transform equals the product M_world(parent) × M_local(child) evaluated recursively from the scene root. Note that any node targeted by an animation channel is strictly required by Khronos rules to use decomposed TRS properties rather than a raw matrix.
Deeply nested empty locators left over from CAD assembly imports or FBX root-axis conversions (-90° X rotation paired with 0.01 scale) routinely break runtime attachment points, bounding-box picking, and physics colliders—especially when non-uniform parent scale introduces shear into rotated child normals. Inspecting the flattened parent chain alongside exact world-translation columns [m12, m13, m14] pinpoints which ancestor node introduced an unexpected offset.
- Reconstructs full ancestor chains from root scene nodes down to leaf mesh and bone nodes.
- Computes exact 16-element column-major localMatrix and worldMatrix values in the Worker.
- Tags every node targeted by animation channels so riggers can verify clean TRS decomposition.
Tracing ParentRoot to AnimatedChild in animated-child.glb
In animated-child.glb, node 0 (ParentRoot) parents node 1 (AnimatedChild), which carries mesh 0 (SingleTriangle) and receives translation keyframes from Clip 0 while maintaining a clean rest-pose identity world matrix.