A SERVICE OF

logo

Group Nodes
59
csLOD(level-of-detail) is a switch that selects one of its children based on the
distance between the camera and the shape encapsulated by the csLOD; the closer
the shape, the greater the detail used when rendering the shape, the farther away
the shape, the less detailed the shape. For more information, see Chapter 14,
Optimizing Rendering.
csTransformpositions and orients a shape in the coordinate system of the parent
node to csTransform. For more information, see Chapter 6, Placing Shapes in a
Scene.
csEnvironmentis a grouping node which denes the scope of inuence for the
effects provided by csLight. For more information, see Chapter 8, Lighting and
Fog.
Using csSwitch to Switch Between Nodes
The csSwitch node selects none, one, or all of its children. The constructor has the
following prototype:
csSwitch();
To specify whether none, one, or all of a csSwitch nodes children are selected, use the
following member function:
void setWhichChild(int which);
The possible values of which are
NO_CHILDRENto select no nodes
an integerto specify a child node
ALL_CHILDRENto select all of the children of the csSwitch node
Each child of a switch node is assigned an index number when added to the group node:
the rst child added is index 0, the second child added is index 1, and so on.
You might use a csSwitch node to create an animation sequence. For example, if each of
the ve child nodes of a csSwitch node contained the image of a character in different
stages of walking, your application could switch sequentially between the child nodes to
create a simple animation sequence.