Two-level scene graph

Here’s a program for experimenting with transformations in a scene graph.

Two-level scene graph

Here, parent is a child of the scene node, and child (the red box) is in turn a child of parent. The world coordinate space is depicted by the thin axes of length 10, whereas the parent’s local space is depicted by thick axes of length 1. Translation and scale are supported only in x and y and rotation only around the z-axis, which is enough to understand how things work.

In the child system, try translating by 1 unit along the x-axis to see where the unit mark lies along the thick axes, which is actually where the axis’s cylinder meets its arrow. (While the parent’s parameters are unchanged, the parent space is identical to the world space.)

Also try scaling by 2 in the parent space along the x-axis, and then translate by 1 unit along the x-axis in the child space. Notice that the box has doubled in length and that it’s now centered at the end of the thick red axis. This corresponds to the point (1,0,0) in the parent’s space, which is (2,0,0) in world space coordinates. Experiment.