I've hit a snag when it comes to this.

Basically I have 3D objects that are organized like a graph of nodes; each node contains a mesh.

For drawing these I traverse the nodes recursively, top to bottom, and set the final transform matrix of each node to that of its parent's full transform multiplied with the node's own local transform. This seems to work like intended and I can have relative transforms for each node.

However, if I set the scale of the topmost node it follows that the relative positions of the child nodes have to change too, or everything will just be scaled in-place, without being repositioned in accordance to each other. Take for example a compound object consisting of two cubes positioned close to each other but with a gap between them. Doubling the scale of this object will indeed make the boxes render twice as large, but since the translation remains the same the gap is now gone and the boxes are overlapping. Not the desired outcome.

I suppose you can just manually transform the matrices of any child nodes by the parents scale matrix when changing the scale, but this just doesn't sound like the best solution to me. Is there another, "standard" way of going about this?

Thanks for any suggestions,

Husbjörn