204
Appendix B: Cosmo 3D Sample Application
In cube.cxx, csGeometry defines a cube and the csAppearance nodes specify the green
and red colors of the cubes.
Note: Neither csGeometry nor csAppearance are nodes; they are classes associated by a
csShape node.
Relating Local Space to World Space
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.
Objects in world space are rendered when a draw action is applied to the root node of the
scene graph. Objects in local space are 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.
Generally, there are many transformation nodes in a scene graph and a shape is often
transformed more than once, as shown in Figure B-3.