Java Reference
In-Depth Information
Briefly, in this chapter, we will discuss the important interpolator classes by using a
number of illustrating examples, followed by some details discussions on the billboard
and LOD classes.
behavIor and anImatIon
Java 3D implements animation through the use of behavior objects created under the
behavior class. This is an abstract class that allows codes to be included so that the scene
graph can be changed. Essentially, a behavior object in a scene graph serves to change the
scene graph or some objects in the scene graph in response to some stimulus.
User actions such as pressing a key or moving the mouse correspond to stimulus associ-
ated with interaction and will be discussed in the next chapter. On the other hand, stimulus
such as the passage of time, which requires no user action, is used in animation (Bund &
Do, 2005; Burrows & England, 2002).
The Java 3D API provides a number of useful classes for animation, and it is in general
not necessary for any new class to be created. In particular, the interpolator class can be
used to create animation through the use of an interpolator and an “alpha” object, which
will be discussed in the next section.
alpha obJect
Basically, an alpha object generates alpha values in the range of [0,1] when it is sampled
over a period of time. The alpha values generated is for the primary use of an associated
interpolator object, which will be discussed in the next section.
Depending on the parameters of the alpha object, the generated alpha value may change
over time. Specifically, there are four phases in an alpha object waveform: increasing
alpha, alpha at one, decreasing alpha, and alpha at zero. These four phases make up one
cycle of the alpha waveform, and can be controlled by four sets of parameters of the alpha
object. Also, the durations of the phases are given by an integer, which gives the duration
in milliseconds.
An alpha object has the following important parameters.
loopCount: The number of times that the alpha object will be run. The object will
be run in an infinite loop manner if a value of -1 is given.
triggerTime: The time in milliseconds after the system start time that the object will
be first triggered. If the current time is equal to or more than the sum of the system
start time and triggerTime, the object will be started as soon as possible.
Search WWH ::

Custom Search