3 days have passed, i just finished Chapter 2.
3 major ways to create new geometric content:
- using Geometry Utility classes(Geometry primitives that do not contain Appearance information such as color)
- using vertex coordinates
- 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
- Non-indexed vertex-based Geometry ( each vertex is used only once )
- Indexed vertex-based Geometry ( vertex can be reused )
how to use GeometryArray object to create a Shape3D object?
- construction of an empty object
GeometryArray( vertex count , vertex format )
- Filling the object with data
setColor[s] ( index , Color )
- Make Shape3D object reference the GeometryArray Object.
new Shape3D ( GeometryArray )
if vertices in a triangle have different colors, it will automatically interpolate.
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