Well, if you can already calculate the matrix then it should be simple to extract this info from it. The world position is just the translation part of the world matrix (4th row or 4th column depending on convention - also known as the point you get out if you multiply (0, 0, 0, 1) by the world matrix). The rotation and scale may not be easily separable if you have non-uniform scaling somewhere between the node and the root, but assuming you do not, you can calculate the overall scaling factor by looking at the length of the X axis of the world matrix (first row/column), then get the rotation part by taking the 3x3 upper-left submatrix and dividing out the scale factor.

That being said you should also be able to calculate this information directly if you want. The world position, for instance, should be equal to taking the origin point (0, 0, 0, 1) and multiplying up the hierarchy by all the child-to-parent matrices. The scale factor (again assuming uniform scaling only) should be the product of all the scaling factors at each node from child to root, and the rotation should similarly be the product of all the rotations from child to root.

Ugh, I feel like one of those things “I should just know”. Anyway, I have a parent-child system set up for a simple (very simple) animation system I’m putting together. The main idea being I can animate simpler parts of the world without having to wait on an artist.

For getting the world matrix of a child, that’s easy, I simply multiply by each parent nodes’ world matrix in the correct order. This works and I have it down. What I can’t seem to do is correctly update the actual vectors held like:

vec3 worldPosition

vec3 worldRotation

vec3 worldScale

I’ve tried many things, such as multiplying (transforming) by their parent matricies, adding to position/rotation, multiplying by scale, ect, but it isn’t coming out right. So how do I transform the “node space” (or model space) positions, rotations and scales to world space while correctly staying aligned with the parent?

Any help is much appreciated.