Java 3D Tutorial 1

key point: scene graph and some recipes.
before writing a Java 3D program, you'd draw a Scene Graph first.

Recipe for writing Java 3D programs:

  1. Create a Canvas3D object
  2. Create a VirtualUniverse object
  3. Create a Locale object, attaching it to the VirtualUniverse object
  4. Construct a view branch graph
    1. Create a View object
    2. Create a ViewPlatform object
    3. Create a PhysicalBody object
    4. Create a PhysicalEnvironment object
    5. Attach ViewPlatform, PhysicalBody, PhysicalEnvironment, and Canvas3D objects to View object
  5. Construct content branch graph(s)
  6. Compile branch graph(s)
  7. Insert subgraphs into the Locale

a simple version, with SimpleUniverse:

  1. Create a Canvas3D Object
  2. Create a SimpleUniverse object which references the earlier Canvas3D object
    1. Customize the SimpleUniverse object
  3. Construct content branch
  4. Compile content branch graph
  5. Insert content branch graph into the Locale of the SimpleUniverse

a recipe for creating an interpolation animation behavior:

  1. Create a target TransformGroup
    Set the ALLOW_TRANSFORM_WRITE capability
  2. Create an Alpha5 object
    Specify the time parameters for the alpha
  3. Create the interpolator object
    Have it reference the Alpha and TransformGroup objects
    Customize the behavior parameters
  4. Specify a scheduling region
    Set the scheduling region for the behavior
  5. Make the behavior a child of the TransformGroup

Comments