Behavior Class



Most of the work in typical Java 3D program is writing Behavior classes

A Behavior class changes the scenegraph in response to a stimulus

Possible stimuli:
  user(ie mouse, keyboard, exotic input device ...)
  collisions   time
  View location

Possible objects of change:
  TransformGroup
  Geometry
  Scenegraph
  View

Our example, MorphBehavior, wakes up immediately, then uses an alpha value (= number between 0 and 1) to change the weights in our Morph object

The alpha value we feed it comes from an Alpha class that changes it as function of time



previous  start  toc  next