Graphics Reference
In-Depth Information
ject, we typically do not change the basic geometry of the primitives (e.g.,
we do not change the vertices of R a 0 to rotate it).
• Interactive control of a graphical object is accomplished via manipulating
transformation operators (e.g., the m _ ArmXform , M a ).
• Components on a graphical object (e.g., the palm on the arm) can be in-
dependently transformed when separate transformation operators (e.g., the
m _ PalmXform , M p ) are concatenated in a tree-like hierarchical ordering.
UWBGL_D3D_Lib11
Change summary. See p. 523
for a summary of changes to
the library.
This library introduces the SceneNode class to extend Lib10 . As illustrated in
Figure 11.5, the SceneNode class encapsulates the functionality of the above ob-
servations.
XformInfo
PrimitiveList . This list references the primitives that define the graphi-
cal object (e.g., R a 0 of the arm, or C p 0 of the palm).
Velocity
PrimitiveList
XformInfo . This is the transformation operator with which we can control
the graphical object (e.g., the m _ ArmXform forthearmorthe m _ PalmXform
for the palm).
Child SceneNodes
Figure 11.5.
A Scene
Node .
Child SceneNodes . These are references to child SceneNode objects al-
lowing the building of a tree structure to support ordered concatenation of
the transformation operator.
Velocity . This is defined for the convenience of moving the SceneNode .
For example, to implement constant movement of a SceneNode object,
our program code can periodically update the translation operator in the
XformInfo object with this velocity.
Listing 11.3 shows the implementation of the structure illustrated by Figure 11.5,
where m _ pPrimitive at label A can reference UWB _ PrimitiveList for a list of
geometric primitives. The m _ xform object at label B is designed to support trans-
forming all geometries referenced by m _ pPrimitive .The m _ child _ nodes array
at label C allows the definition of child nodes for building a tree-like hierarchy of
SceneNodes . As explained, the velocity at label D is meant for updating the trans-
lation of the m _ xform object. As will be shown later, to support a friendly user
interface, the m _ Name at label E allows definition of a meaningful name for each
node.
Search WWH ::




Custom Search