The ColoringAttributes object defines attributes used in color selection and shading model.
Color
The setColor
methods set the current intrinsic red, green, and blue color values of this ColoringAttributes component object. This color is only used for unlit geometry. If lighting is enabled, the material colors are used in the lighting equation to produce the final color. When vertex colors are present in unlit geometry, those vertex colors are used in place of this ColoringAttributes color, unless the vertex colors are ignored.
There are two variations on the setColor
methods, one that takes a Color3f and one that takes three floats. No alpha value is allowed (it's automatically set to 1.0). The float values range between 0.0 and 1.0, with 1.0 being full intensity of the color. A color value of (1.0, 1.0, 1.0) is white.
Shading Model
The setShadeModel
method sets the shade model for this ColoringAttributes component object. The shade model may be one of the following:
- FASTEST - use the fastest available method for shading. This shading mode maps to whatever shading model the Java 3D implementor defines as the "fastest," which may be hardware-dependent.
- NICEST - use the nicest (highest quality) available method for shading. This shading mode maps to whatever shading model the Java 3D implementor defines as the "nicest," shading model, which may be hardware-dependent.
- SHADE_FLAT - use the flat shading model. This shading model does not interpolate color across the primitive. The primitive is drawn with a single color and the color of one vertex of the primitive is duplicated across all the vertices of the primitive.
- SHADE_GOURAUD - use the Gouraud (smooth) shading model. This shading model smoothly interpolates the color at each vertex across the primitive. The primitive is drawn with many different colors and the color at each vertex is treated individually. For lines, the colors along the line segment are interpolated between the vertex colors. This is the default shade model if no other is specified.
@see Appearance