Java 3D tutorials 2

3 days have passed, i just finished Chapter 2.

About Geometry.

3 major ways to create new geometric content:

  1. using Geometry Utility classes(Geometry primitives that do not contain Appearance information such as color)
  2. using vertex coordinates
  3. using Geometry loader

Shape3D object does not contain the information about shape or color. These informations are stored in Geometry and Appearance objects referenced by Shape3D objects.
each Shape3D object references an object derived from Geometry.

subclasses of Geometry

  1. Non-indexed vertex-based Geometry ( each vertex is used only once )
  2. Indexed vertex-based Geometry ( vertex can be reused )
  3. ......

how to use GeometryArray object to create a Shape3D object?

  1. construction of an empty object
       GeometryArray( vertex count , vertex format )
  2. Filling the object with data
       setCoordinate[s]( index , Point )
       setColor[s] ( index , Color )
  3. Make Shape3D object reference the GeometryArray Object.
       new Shape3D ( GeometryArray )

if vertices in a triangle have different colors, it will automatically interpolate.

Appearance
an Appearance object reference several objects of other subclasses of the NodeComponent abstract class.
the Appearance object can be called "appearance bundle"
Appearance attribute classes: PointAttributes, LineAttributes, PolygonAttributes, ColoringAttributes, TransparancyAttributes, RenderingAttributes, ......
it's legal for several objects to reference the same NodeComponent objects.

Right hand rule: the front face of a polygon is the side for which the vertices are appear in counter-clock wise order.
Cull : do not render


Last modified on 2007-08-26