specifies the geometrical shape of the visual object to be rendered. How this specification
can be written will be discussed in subsequent sections.
As discussed earlier in the first section, the shape of the visual object to be rendered is speci-
fied by a geometry object, which is a component under a Shape3D object. The creation of a
geometry object can be done using the geometry class, which is an abstract superclass.
Under the geometry class (Java 3D API specification, 2006), a useful abstract subclass
is the GeometryArray class and the class hierarchy is shown in Figure 4. Figure 5 illustrates
the geometry subclasses.
Before any objects can be created, the number of vertices the object is going to have
and their respective coordinates must first be planned out. One must remember to plan the
coordinates in an anti-clockwise direction because this is the default for determining the
front side of a polygon. Line, Quad, Triangle, and PointArrays have two general construc-
tors. Figure 6 gives the format for specifying the vertices of Shape3D objects, where X
stands for Point, Line, Quad, or Triangle.
The default coordinate system that is being used is the right hand system. Basically,
when facing the screen, +X is to the right, +Y is up and +Z is towards the viewer as shown
is Figure 7.
Figure 4. GeometryArray class hierarchy