public class ColoringAttributes extends NodeComponent
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:
Appearance
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_COLOR_READ
Specifies that this ColoringAttributes object allows
reading its color component information.
|
static int |
ALLOW_COLOR_WRITE
Specifies that this ColoringAttributes object allows
writing its color component information.
|
static int |
ALLOW_SHADE_MODEL_READ
Specifies that this ColoringAttributes object allows
reading its shade model component information.
|
static int |
ALLOW_SHADE_MODEL_WRITE
Specifies that this ColoringAttributes object allows
writing its shade model component information.
|
static int |
FASTEST
Use the fastest available method for shading.
|
static int |
NICEST
Use the nicest available method for shading.
|
static int |
SHADE_FLAT
Do not interpolate color across the primitive.
|
static int |
SHADE_GOURAUD
Smoothly interpolate the color at each vertex across the primitive.
|
Constructor and Description |
---|
ColoringAttributes()
Constructs a ColoringAttributes node with default parameters.
|
ColoringAttributes(Color3f color,
int shadeModel)
Construct ColoringAttributes object with specified values.
|
ColoringAttributes(float red,
float green,
float blue,
int shadeModel)
Construct ColoringAttributes object with specified values.
|
Modifier and Type | Method and Description |
---|---|
NodeComponent |
cloneNodeComponent()
Deprecated.
replaced with cloneNodeComponent(boolean forceDuplicate)
|
void |
getColor(Color3f color)
Gets the intrinsic color of this ColoringAttributes
component object.
|
int |
getShadeModel()
Gets the shade mode for this ColoringAttributes component object.
|
void |
setColor(Color3f color)
Sets the intrinsic color of this ColoringAttributes
component object.
|
void |
setColor(float r,
float g,
float b)
Sets the intrinsic color of this ColoringAttributes
component object.
|
void |
setShadeModel(int shadeModel)
Sets the shade mode for this ColoringAttributes component object.
|
String |
toString()
Returns a String representation of this ColoringAttributes object.
|
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, updateNodeReferences
public static final int ALLOW_COLOR_READ
public static final int ALLOW_COLOR_WRITE
public static final int ALLOW_SHADE_MODEL_READ
public static final int ALLOW_SHADE_MODEL_WRITE
public static final int FASTEST
public static final int NICEST
public static final int SHADE_FLAT
public static final int SHADE_GOURAUD
public ColoringAttributes()
public ColoringAttributes(Color3f color, int shadeModel)
color
- the intrisic colorshadeModel
- the shade model used; one of FASTEST, NICEST,
SHADE_FLAT, or SHADE_GOURAUDpublic ColoringAttributes(float red, float green, float blue, int shadeModel)
red
- red component of the intrisic colorgreen
- green component of the intrisic colorblue
- blue component of the intrisic colorshadeModel
- the shade model used; one of FASTEST, NICEST,
SHADE_FLAT, or SHADE_GOURAUDpublic void setColor(Color3f color)
color
- the color that is used when lighting is disabled
or when material is nullCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphMaterial
,
RenderingAttributes.setIgnoreVertexColors(boolean)
public void setColor(float r, float g, float b)
r
- the red component of the colorg
- the green component of the colorb
- the blue component of the colorCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphMaterial
,
RenderingAttributes.setIgnoreVertexColors(boolean)
public void getColor(Color3f color)
color
- the vector that will receive colorCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setShadeModel(int shadeModel)
shadeModel
- the shade mode to be used; one of FASTEST,
NICEST, SHADE_FLAT, or SHADE_GOURAUDCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getShadeModel()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic NodeComponent cloneNodeComponent()
cloneNodeComponent
in class NodeComponent
public String toString()
toString
in class SceneGraphObject
Copyright © 2016–2022 SciJava. All rights reserved.