The first seven node components will be discussed in this chapter, while the remaining
three classes are texture related and will be discussed in Chapter X.
Figure 2 shows the appearance constructor for creating an appearance object with all
component object references initialized to null. Some important default values correspond-
ing to null references are also listed in this figure.
To enable code sharing, it is possible for different Shape3D objects to reference the same
appearance and NodeComponent Objects. An example is illustrated in Figure 3.
In addition to code sharing, using the same NodeComponents may also lead to an im-
provement in performance. For instance, if several appearance components share the same
LineAttributes component and “antialiasing” is enabled, the Java3D rendering engine may
decide to group the antialiased wire frame shapes together. This would minimize turning
antialiasing on and off, and result in faster graphics rendering.
Figure 2. Appearance constructor and default values
Appearance appear = new Appearance ()
Points and lines
Size and width of 1 pixel, no antialiasing
Enabled, read and write accessible
Figure 3. Sharing appearance and NodeComponent objects
Search WWH ::