Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLMaterialNodeType

All Superinterfaces:
FrameStateListener, VRMLAppearanceChildNodeType, VRMLNode, VRMLNodeType, VRMLSurfaceMaterialNodeType, VRMLVisualMaterialNodeType
All Known Subinterfaces:
OGLMaterialNodeType

public interface VRMLMaterialNodeType
extends VRMLVisualMaterialNodeType

Node specifies colour properties for associated geometry.

Defines methods needed for standard VRML lighting model equations

Version:
$Revision: 1.10 $
Author:
Alan Hudson

Method Summary
 void addMaterialColorListener(MaterialColorListener l)
          Add a listener instance for the material color change notifications.
 float getAmbientIntensity()
          Accessor method to get current value of field ambientIntensity.
 float[] getDiffuseColor()
          Accessor method to get current value of field diffuseColor.
 float[] getEmissiveColor()
          Accessor method to get current value of field emissiveColor.
 float getShininess()
          Get current value of the shinines field.
 float[] getSpecularColor()
          Get current value of the specularColor field.
 float getTransparency()
          Accessor method to get current value of field transparency.
 void removeMaterialColorListener(MaterialColorListener l)
          Remove a listener instance from this node.
 void setAmbientIntensity(float newAmbientIntensity)
          Accessor method to set a new value for field attribute ambientIntensity.
 void setDiffuseColor(float[] newDiffuseColor)
          Accessor method to set a new value for field attribute diffuseColor.
 void setEmissiveColor(float[] newEmissiveColor)
          Accessor method to set a new value for field attribute emissiveColor.
 void setIgnoreDiffuse(boolean ignore)
          Ignore the diffuseColor color term and use 1,1,1 for the diffuse color.
 void setShininess(float newShininess)
          Accessor method to set a new value for field attribute shininess.
 void setSpecularColor(float[] newSpecularColor)
          Accessor method to set a new value for field attribute specularColor.
 void setTransparency(float newTransparency)
          Set a new value for the transparency.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Method Detail

setAmbientIntensity

void setAmbientIntensity(float newAmbientIntensity)
                         throws InvalidFieldValueException
Accessor method to set a new value for field attribute ambientIntensity. How much ambient omnidirectional light is reflected from all light sources.

Parameters:
newAmbientIntensity - The new intensity value
Throws:
InvalidFieldValueException

getAmbientIntensity

float getAmbientIntensity()
Accessor method to get current value of field ambientIntensity. Default value is 0.2

Returns:
The current ambientIntensity

setDiffuseColor

void setDiffuseColor(float[] newDiffuseColor)
                     throws InvalidFieldValueException
Accessor method to set a new value for field attribute diffuseColor. How much direct, angle-dependent light is reflected from all light sources.

Parameters:
newDiffuseColor - The new value of diffuseColor
Throws:
InvalidFieldValueException

getDiffuseColor

float[] getDiffuseColor()
Accessor method to get current value of field diffuseColor. Default value is 0.8 0.8 0.8.

Returns:
The current value of diffuseColor

setEmissiveColor

void setEmissiveColor(float[] newEmissiveColor)
                      throws InvalidFieldValueException
Accessor method to set a new value for field attribute emissiveColor. How much glowing light is emitted from this object.

Parameters:
newEmissiveColor - The new value of EmissiveColor
Throws:
InvalidFieldValueException

getEmissiveColor

float[] getEmissiveColor()
Accessor method to get current value of field emissiveColor. Default value is 0 0 0.

Returns:
The current value of EmissiveColor

setShininess

void setShininess(float newShininess)
                  throws InvalidFieldValueException
Accessor method to set a new value for field attribute shininess. Low values provide soft specular glows, high values provide sharper, smaller highlights.

Parameters:
newShininess - The new value of Shininess
Throws:
InvalidFieldValueException

getShininess

float getShininess()
Get current value of the shinines field. Default value is 0.2.

Returns:
The current value of Shininess

setSpecularColor

void setSpecularColor(float[] newSpecularColor)
                      throws InvalidFieldValueException
Accessor method to set a new value for field attribute specularColor. Specular highlights are brightness reflections (example: shiny spots on an apple).

Parameters:
newSpecularColor - The new value of SpecularColor
Throws:
InvalidFieldValueException

getSpecularColor

float[] getSpecularColor()
Get current value of the specularColor field. Default value is 0 0 0.

Returns:
The current value of SpecularColor

setTransparency

void setTransparency(float newTransparency)
                     throws InvalidFieldValueException
Set a new value for the transparency. 1.0 is completely transparent, 0.0 is completely opaque.

Parameters:
newTransparency - The new value of Transparency
Throws:
InvalidFieldValueException

getTransparency

float getTransparency()
Accessor method to get current value of field transparency. Default value is 0

Returns:
The current value of Transparency

setIgnoreDiffuse

void setIgnoreDiffuse(boolean ignore)
Ignore the diffuseColor color term and use 1,1,1 for the diffuse color.

Parameters:
ignore - True to ignore the diffuse term

addMaterialColorListener

void addMaterialColorListener(MaterialColorListener l)
Add a listener instance for the material color change notifications. Adding the same instance more than once is ignored. Adding null values are ignored.

Parameters:
l - The new instance to add

removeMaterialColorListener

void removeMaterialColorListener(MaterialColorListener l)
Remove a listener instance from this node. If the listener is not currently registered, the request is silently ignored.

Parameters:
l - The new instance to remove

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium