83
Chapter 7
7. Traversing the Scene Graph
Once you create a scene graph, you apply an action to the root node to trigger the events
prescribed in the scene graph nodes. Most nodes include an overwritten apply() method
that triggers an appropriate response when a specific action is applied to the node.
Actions include rendering the scene (draw action) and playing sound files (sound
action).
This chapter describes how an action traverses a scene graph and the actions available in
Cosmo 3D.
This chapter has the following sections:
•“Scene Graph Actions” on page 83.
•“The Order In Which Actions Are Passed Between Nodes” on page 86.
Scene Graph Actions
An action is an operation that is carried out on one or more nodes in a scene graph. In
response to actions,
• csLeaf nodes set values.
• csGroup nodes pass actions from one child node to another.
For example, when a csDrawAction is applied to the root node of a scene graph, the
action operates on (potentially) all of the nodes in the scene graph so that all of the
csShape nodes in it are rendered.