To create 3D graphics, we have to build graphics or visual objects and position them ap-
propriately in a virtual scene. In general, there are three possible approaches for doing this
(Java 3D geometry, 2006).
One approach is to make use of geometry utility classes to create basic geometric
shapes or primitives. The basic shapes are boxes, spheres, cones, and cylinders. Another
approach is to employ commercial modeling tools, such as 3D studio max, and have the
results loaded into Java 3D. Lastly, custom geometrical shapes or objects can also be cre-
ated by defining their vertices.
While using utility classes or commercial modeling tools may be simpler and less time
consuming, creating objects based on specifying vertices corresponds to the most general
method. From a certain angle, the latter can in fact be regarded as the foundation from
which the other approaches are based. The main thrust in this chapter will thus be on how
objects can be built from their vertices, with some brief discussion on using utility classes
presented toward the end of the chapter.
As specified in the constructor of Figure 1, the most basic method for creating and specify-
ing the geometry and appearance of an object is through the Shape3D class. The geometry
Search WWH ::