Scene Graph Construction Classes
9
The csTransform Class
A csTransform is a csGroup that allows applications to apply a transformation to all of
its children. A csTransformAction pushes down an action’s matrix stack, applies the
transform to the top of the stack, visits the children, and then pop the action’s matrix
stack.
See “Transforming Shapes to New Locations, Sizes, and Orientations” on page 79 for
more information.
Once you define the orientation of a shape, you use csTransform nodes to place and
orient the shape in a different coordinate system. World space is the coordinate system of
the root node. If all the shapes in a scene graph are transformed into world space, a
csCamera object attached to the root node can view all the shapes in the scene graph
together in one coordinate system.
World space is rendered when a draw action is applied to the root node of the scene
graph; local space is rendered when a draw action is applied to a subsection of the scene
graph. The same object rendered in these two spaces may appear different, for example,
a shape in world space may appear smaller than in local space because it is farther from
the viewer; it might also be rotated and positioned differently.
There are usually many transformation nodes in a scene graph and a shape is often
transformed more than once. Figure 1-2 illustrates how a leaf node is first transformed
twice, then placed in world space.