All Packages Class Hierarchy This Package Previous Next Index
Class java.media.j3d.Material
java.lang.Object
|
+----java.media.j3d.SceneGraphObject
|
+----java.media.j3d.NodeComponent
|
+----java.media.j3d.Material
- public class Material
- extends NodeComponent
The Material object defines the appearance of an object under
illumination.
-
ALLOW_COMPONENT_READ
- For material object, specifies that Material allows reading
individual component field information.
-
ALLOW_COMPONENT_WRITE
- For material object, specifies that Material allows reading
individual component field information.
-
Material()
- Constructs and initializes a material object using default parameters.
-
Material(Color3f, Color3f, Color3f, Color3f, float)
- Constructs and initializes a new material object using the specified
parameters.
-
getAmbientColor(Color3f)
- Retrieves this material's ambient color.
-
getDiffuseColor(Color3f)
- Retrieves this material's diffuse color.
-
getEmissiveColor(Color3f)
- Retrieves this material's emissive color and stores it in the
argument provided.
-
getLightingEnable()
- Retrieves the state of the lighting enable flag.
-
getShininess()
- Retrieves this material's shininess.
-
getSpecularColor(Color3f)
- Retrieves this material's specular color.
-
setAmbientColor(Color3f)
- Sets this material's ambient color.
-
setAmbientColor(float, float, float)
- Sets this material's ambient color.
-
setDiffuseColor(Color3f)
- Sets this material's diffuse color.
-
setDiffuseColor(float, float, float)
- Sets this material's diffuse color.
-
setDiffuseColor(float, float, float, float)
- Sets this material's diffuse color plus alpha.
-
setEmissiveColor(Color3f)
- Sets this material's emissive color.
-
setEmissiveColor(float, float, float)
- Sets this material's emissive color.
-
setLightingEnable(boolean)
- Enables or disables lighting for this appearance component object.
-
setShininess(float)
- Sets this material's shininess.
-
setSpecularColor(Color3f)
- Sets this material's specular color.
-
setSpecularColor(float, float, float)
- Sets this material's specular color.
-
toString()
- Returns a String representation of this Materials values.
ALLOW_COMPONENT_READ
public static final int ALLOW_COMPONENT_READ
- For material object, specifies that Material allows reading
individual component field information.
ALLOW_COMPONENT_WRITE
public static final int ALLOW_COMPONENT_WRITE
- For material object, specifies that Material allows reading
individual component field information.
Material
public Material()
- Constructs and initializes a material object using default parameters.
This object is white in color, with no specular component, and is
fully opaque. Lighting is enabled by default.
Material
public Material(Color3f ambientColor,
Color3f emissiveColor,
Color3f diffuseColor,
Color3f specularColor,
float shininess)
- Constructs and initializes a new material object using the specified
parameters. Lighting is enabled by default.
- Parameters:
- ambientColor - the material's ambient color
- emissiveColor - the material's emissive color
- diffuseColor - the material's diffuse color when illuminated by a
light
- specularColor - the material's specular color when illuminated
to generate a highlight
- shininess - the material's shininess in the
range [0.0, 128.0] with 0.0 being not shiny and 128.0 being very shiny
setAmbientColor
public final void setAmbientColor(Color3f color)
- Sets this material's ambient color.
This specifies how much ambient light is reflected by
the surface.
- Parameters:
- color - the material's ambient color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setAmbientColor
public final void setAmbientColor(float r,
float g,
float b)
- Sets this material's ambient color.
This is the color of light, if any, that the material emits.
- Parameters:
- r - the new ambient color's red component
- g - the new ambient color's green component
- b - the new ambient color's blue component
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getAmbientColor
public final void getAmbientColor(Color3f color)
- Retrieves this material's ambient color.
- Parameters:
- color - that will contain the material's ambient color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setEmissiveColor
public final void setEmissiveColor(Color3f color)
- Sets this material's emissive color.
This is the color of light, if any, that the material emits.
- Parameters:
- color - the new emissive color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setEmissiveColor
public final void setEmissiveColor(float r,
float g,
float b)
- Sets this material's emissive color.
This is the color of light, if any, that the material emits.
- Parameters:
- r - the new emissive color's red component
- g - the new emissive color's green component
- b - the new emissive color's blue component
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getEmissiveColor
public final void getEmissiveColor(Color3f color)
- Retrieves this material's emissive color and stores it in the
argument provided.
- Parameters:
- color - the vector that will receive this material's emissive color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setDiffuseColor
public final void setDiffuseColor(Color3f color)
- Sets this material's diffuse color.
This is the color of the material when illuminated by a light source.
- Parameters:
- color - the new diffuse color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setDiffuseColor
public final void setDiffuseColor(float r,
float g,
float b)
- Sets this material's diffuse color.
- Parameters:
- r - the new diffuse color's red component
- g - the new diffuse color's green component
- b - the new diffuse color's blue component
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setDiffuseColor
public final void setDiffuseColor(float r,
float g,
float b,
float a)
- Sets this material's diffuse color plus alpha.
This is the color of the material when illuminated by a light source.
- Parameters:
- r - the new diffuse color's red component
- g - the new diffuse color's green component
- b - the new diffuse color's blue component
- a - the alpha component used to set transparency
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getDiffuseColor
public final void getDiffuseColor(Color3f color)
- Retrieves this material's diffuse color.
- Parameters:
- color - the vector that will receive this material's diffuse color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setSpecularColor
public final void setSpecularColor(Color3f color)
- Sets this material's specular color.
This is the specular highlight color of the material.
- Parameters:
- color - the new specular color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setSpecularColor
public final void setSpecularColor(float r,
float g,
float b)
- Sets this material's specular color.
This is the specular highlight color of the material.
- Parameters:
- r - the new specular color's red component
- g - the new specular color's green component
- b - the new specular color's blue component
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getSpecularColor
public final void getSpecularColor(Color3f color)
- Retrieves this material's specular color.
- Parameters:
- color - the vector that will receive this material's specular color
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setShininess
public final void setShininess(float shininess)
- Sets this material's shininess.
This specifies a material specular scattering exponent, or
shininess. It takes a floating point number in the range [0.0, 128.0]
with 0.0 being not shiny and 128.0 being very shiny.
- Parameters:
- shininess - the material's shininess
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getShininess
public final float getShininess()
- Retrieves this material's shininess.
- Returns:
- the material's shininess
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
setLightingEnable
public final void setLightingEnable(boolean state)
- Enables or disables lighting for this appearance component object.
- Parameters:
- state - true or false to enable or disable lighting
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
getLightingEnable
public final boolean getLightingEnable()
- Retrieves the state of the lighting enable flag.
- Returns:
- true if lighting is enabled, false if lighting is disabled
- Throws: CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
toString
public String toString()
- Returns a String representation of this Materials values.
If the scene graph is live only those values with their
Capability read bit set will be displayed.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index