Say I have a scene graph, and each node has a scale, rotation, and translation. Can I combine these into a single scale, rotation, and translation?
Yes you can, provided that all the nodes' scales are only uniform scaling—the same scaling factor along all three axes. If there is nonuniform scaling (different factors along different axes) then things get more complicated, and the composed transformation generally can't be decomposed cleanly into scale, rotation, and translation.
One way to accomplish this is to convert all the individual nodes' transforms into 4×4 matrix form, multiply the matrices down the tree from root to leaf, then decompose the resulting matrix (see this answer for how to do the decomposition).
However, if you have all the transforms in TRS form (translate, rotate, scale—assuming column vector convention) and you want the final transform in TRS form, you can also combine them directly.
- The final scale is just the product of all the individual nodes' scales
- The final rotation is just the composition of all the individual nodes' rotations (in quaternion form for example)
- The final translation is made by summing the translation vectors, but transforming each vector by the composite scale and rotation of all the nodes above it in the tree. For example if you have a transformation $T_1 R_1 S_1 T_2 R_2 S_2 T_3 R_3 S_3$ (numbering from the root down to the leaf), then the final translation is $t_1 + (R_1 S_1) t_2 + (R_1 S_1 R_2 S_2) t_3$.