1. Create a Canvas3D Object
2. Create a SimpleUniverse object which references the earlier Canvas3D object
a. Customize the SimpleUniverse object
3. Construct content branch
4. Compile content branch graph
5. Insert content branch graph into the Locale of the SimpleUniverse
Figure 1-8 Simple Recipe for Writing Java 3D Programs using SimpleUniverse.
The gray box on the next page is the first instance of a reference block in this tutorial. A reference block
lists constructors, methods, or fields of a class. Reference blocks are designed to allow the tutorial reader
to learn basic Java 3D API programming without having another reference at hand. The reference SimpleUniverse Constructors
Package: com.sun.j3d.utils.universe
This class sets up a minimal user environment to quickly and easily get a Java 3D program up and
running. This utility class creates all the necessary objects for a view branch graph. Specifically, this
class creates Locale, VirtualUniverse, ViewingPlatform, and Viewer objects (all with their default
values). The objects have the appropriate relationships to form the view branch graph.
SimpleUniverse provides all functionality necessary for many basic Java 3D applications. Viewer and
ViewingPlatform are convenience utility classes. These classes use the View and ViewPlatform core
classes.
SimpleUniverse()
Constructs a simple virtual universe.
SimpleUniverse(Canvas3D canvas3D)
Construct as simple universe with a reference to the named Canvas3D object.
The SimpleUniverse object creates a complete view branch graph for a virtual universe. The view
branch graph includes an image plate. An image plate is the conceptual rectangle where the content is
projected to form the rendered image. The Canvas3D object, which provides an image in a window on
your computer display, can be thought of as the image plate.
Figure 1-9, shows the relationship between the image plate, the eye position, and the virtual universe.
The eye position is behind the image plate. The visual objects in front of the image plate are rendered to
the image plate. Rendering can be thought of as projecting the visual objects to the image plate. This
idea is illustrated with the four projectors in the image (dashed lines).