next up previous contents index
Next: 3.3 Constructs used in Up: 3. Concepts Previous: 3.1 Storing everything in   Contents   Index

3.2 Describing a whole Scene with a DAG

A DAG can be used for describing the structure of a whole scene.

A special type of node exists for this purpose: the scene graph node. It is connected to 3 other nodes: A list of child scene graph nodes, a list containing a transformation group and/or attribute groups, and finally to a list of geometric primitives (please see chapter 6 for more information about the different node types). Transformations accumulate on a path from the root of the scene to a leaf node.

The following example creates a polyline at two different locations, the structure of the resulting scene graph is shown in figure 3.2.

Example 3: (taken from: data/examples/scenenode1.dat (7.40))

line1 = POLYLINE2( ((0,0), (4,0)) );
trans1 = TRNSF3PT( (0,2), (1,2), (0,3) );
node1 = SCENENODE( (), (TRANSFORMS(trans1)), (line1) );
SCENEROOT = SCENENODE( (node1), (), (line1) );

Figure 3.2: Simple Scene Graph
\begin{figure}\centering\includegraphics{graph2.ps}
\end{figure}


next up previous contents index
Next: 3.3 Constructs used in Up: 3. Concepts Previous: 3.1 Storing everything in   Contents   Index
Administrator 2002-01-20