Chapters 3 through 7 illustrated how different nodes implement the SoGLRenderAction SoGLRenderAction SoGLRenderAction . This action draws the objects represented by a scene graph. Here is how various nodes implement the SoGLRenderAction SoGLRenderAction SoGLRenderAction :
If the node is a group node, it visits each of its children in a specified order. If it is an SoSeparator SoSeparator SoSeparator node, it saves the traversal state before traversing its children and restores it after traversing its children.
If the node is a property node, it often replaces a value in the corresponding element of the traversal state (other property nodes, such as SoTransform SoTransform SoTransform , may have different behaviors). For example:
SoMaterial SoMaterial SoMaterial replaces the values for the current material.
SoLightModel SoLightModel SoLightModel replaces the values for the current lighting model.
SoDrawStyle SoDrawStyle SoDrawStyle replaces the values for the current drawing style.
SoCoordinate3 SoCoordinate3 SoCoordinate3 replaces the values for the current coordinates.
If the node is derived from SoTransformation SoTransformation SoTransformation , it modifies the current transformation matrix. Each new set of values is preconcatenated onto the existing transformation matrix.
If the node is a shape node, it causes its shape to be drawn, using the current elements in the traversal state. Figure 8.2, “ Shared Instances of a Shape Node ” shows an indexed face set instanced in two different groups. When rendered as part of group1, it uses the current elements of the traversal state, causing a red wireframe face set to be drawn. Because subsequent nodes in group2 modify the current material, drawing style, and transformation matrix, the next instance of the indexed face set, later in the graph, appears green and filled. It is also twice as big as the red face set and translated to a new location.