Graphics Reference
In-Depth Information
11.3.2
Discussion
When compared to instancing by sharing of scene node hierarchy, sharing of ge-
ometries is more complex to implement and to work with in general. For example,
we may want to create a new instance of the human model of Figure 11.13. With
the sharing by scene node approach of Figure 11.15, after the creation of the
Base , LeftArm ,and RightArm nodes, we can simply reference an existing CArm
object without any knowledge of the interior structure of the CArm object. This is
compared to the sharing by geometries approach of Figure 11.16, where in order
to share the geometries of the CArm object, we must traverse the CArm hierarchy
to duplicate all internal nodes and create necessary references to the geometries.
However, sharing by geometries does have the important advantage of retaining
independent control over all components. The sharing of scene nodes generalizes
the scene tree structure into a general directed graph, or a scene graph. In general,
as programmers, we must avoid creating cycles in scene graphs. An example of
a scene graph supported in a commercial product is the directed acyclic graph
(DAG) of the Maya Animation System. The UWB _ GL software library does not
support instancing. In other words, we only support the building of scene trees
and not scene graphs. As programmers, when programming with the UWB _ GL API,
we must ensure the integrity of the scene tree structure.
An important aspect of instancing that is not discussed here is the sharing
of primitive attributes. In real commercial systems, users should be given the
option of manipulating the attributes of any primitives independently from the
instancing structure. For example, the user may want the left and right arms to
have slightly different colors. The grouping functionality in graphical editors can
be implemented by creating a parent node common to all group members.
11.4
The Object Coordinate System
We have learned that a scene hierarchy (or a scene tree, or a scene graph) is de-
fined by interconnected scene nodes and provides a framework for interpreting
transformation operators and the drawing of corresponding geometric primitives.
By strategically traversing this hierarchy of scene nodes, with appropriate con-
catenation of transformation operators before the drawing of corresponding ge-
ometric primitives, we can create geometric models of objects while supporting
independent control over components of objects.
To abstract the functionality of a node in the scene hierarchy (or simply the
scene), we have designed the SceneNode class to include a transformation op-
Search WWH ::




Custom Search