Java Reference
In-Depth Information
Figure 3. Simple tree structure
A is the Root of the tree
A
B is “Child” of A and “Parent” of D and
E
B
C
C is “Child” of A
D is “Child” of B
D
D
E
E is “Child” of B
child and have node B as parent. In Java 3D scene graph terminology, both nodes A and
B are group nodes as they have children nodes, while nodes C, D and E are leave nodes as
they are at the end of the tree and have no child.
A simple graphics example would be that A corresponds to a viewing transformation,
which describes how the children B and C under A would be viewed in terms of position
and orientation. B and C may correspond to the geometry for a sphere and a cube in the
virtual world. The children for B, D, and E, may be on a behavior for the sphere rendered
under B to change in size depending on the user mouse clicks, as well as for giving an
interesting sound whenever the sphere has been picked, respectively.
Depending on its nature, certain nodes or objects in the scene graph have capabilities
that can be set to control read and write access to important information or data in the
node. Without setting these node capabilities or permissions appropriately, it may not be
possible to change these data once the node has become live or the associated code has been
compiled. As an example, the relevant capabilities in the sound leave node must be set if
it is desirable to change the aural characteristics of the sound during run time. However,
increasing the number of capabilities will also reduce the ability for Java 3D to optimize
the rendering process and increase computational requirements.
In the tree structure of Figure 3, the lines linking one node to another one corresponds
basically to a parent child relationship (Liang, 2006). Apart from this, in a Java 3D scene
graph, an object in a node can sometimes be referred to or linked in a reference manner to
a NodeComponent object, which is often used to provide more information or attributes
such as colors and appearance associated with the node. In this sense, the NodeComponent
object can in fact be regarded as part of the node.
The advantage of having a tree structure is that only one path exists from the root of
the tree to each of the leave nodes. Such paths are unique for distinct leave nodes and are
 
Search WWH ::




Custom Search