A SERVICE OF

logo

Scene Graph for Cube.cxx
207
Summary
The following procedure summarizes the steps you take to create and render a very
simple scene graph.
1. Create csAppearance and csGeometry containers to dene the appearance and the
geometry of an object. For more information on setting csAppearance values, see
Chapter 3, Specifying the Appearance of Geometries. For more information on
setting csGeometry values, see Chapter 2, Creating Geometries.
2. Relate the csAppearance and csGeometry nodes in a csShape node. For more
information on setting csShape values, see Chapter 2, Creating Geometries.
3. Add the csShape nodes as children of the csTransform nodes. The csTransform
node orients and positions the csShape objects in world space. For more
information on setting csTransform values, see Chapter 6, Placing Shapes in a
Scene.
Note: A csShape node by itself can be a complete scene graph. Typically, however,
scene graphs have many csShape nodes, most of which are connected to other parts
of the scene graph with a csTransform nodes.
4. Add the csTransform nodes to the scene graph. For more information about adding
nodes to scene graphs, see Chapter 6, Placing Shapes in a Scene.
5. Create a window, csWindow, in which to view and interact with the application.
6. Set the current graphical context, csContext.
7. Draw all of the shapes in world space by applying a csDrawAction to the root of the
scene graph. For more information about draw actions, see Chapter 7, Traversing
the Scene Graph.