Java Reference
In-Depth Information
called scene graph paths. Also, by tracing the scene graph path, it is possible to trace the
actions and the bigger objects under which, say, a cube is created in a leave node.
scene Graph for the rotatingcube
To illustrate the relationship of the scene graph structure and the corresponding Java 3D
program, Figure 4 shows the scene graph tree structure for the RotatingCube program of
Figure 1.
As can be seen from Figure 4, the scene graph for generating the rotating cube com-
prises of two major branches, the content branch and the view branch. The former gives
details of the 3D objects to be set up in a 3D universe, while the other specifies how these
objects will be viewed. Before discussing these in detail in the next few sections, we will
first describe the root node of the graph briefly in this section.
Denoted by U1 in Figure 4, the root node of any scene graph in Java3D should be an
instantiation of the VirtualUniverse class. The VirtualUniverse is the highest level container
that will contain all scene graphs, and this includes a list of Locale objects. Most applica-
tions will require only one VirtualUniverse object even though it is possible for Java3D to
support more. However, there may be several Locale nodes in each universe.
Figure 4. Scene graph diagram for RotatingCube example
Virtual
Universe
U1
Locale
L1
Content Branch
View Branch
Branch Group
BG_c
BG_v
TG_c
TG_v
Behavior
Shape3D node
B1
S1
View1
Canvas3D_1
VP
Geometry
Appearance


























Search WWH ::

Custom Search