Figure 1-4 One Possible Fix for Illegal Scene Graph of Figure 1-3
Each scene graph has a single VirtualUniverse. The VirtualUniverse object has a list of Locale objects.
A Locale object provides a reference point in the virtual universe. Think of a Locale object as being a
landmark used to determine the location of visual objects in the virtual universe.
It is technically possible for a Java 3D program to have more than one VirtualUniverse object, thus
defining more than one virtual universe. However, there is no inherent way to communicate among
virtual universes. Further, a scene graph object can not exist in multiple virtual universes
simultaneously. It is highly recommended to use one and only one instance of VirtualUniverse in each
Java 3D program.
While a VirtualUniverse object may reference many Locale objects, most Java 3D programs have only
one Locale object. Each Locale object may serve as the root of multiple subgraphs of the scene graph.
Refer to Figure 1-2 for an example scene graph and note the two subgraph branches from the Locale
object in the figure.
A BranchGroup object is the root of a subgraph, or branch graph. There are two different categories of
scene subgraph: the view branch graph and the content branch graph. The content branch graph
specifies the contents of the virtual universe - geometry, appearance, behavior, location, sound, and
lights. The view branch graph specifies the viewing parameters such as the viewing location and
direction. Together, the two branches specify much of the work the renderer has to do.