Xj3D VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLMaterialNodeType

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

public interface VRMLMaterialNodeType
extends VRMLVisualMaterialNodeType

Node specifies visual surface material properties for associated geometry.

Defines methods needed for standard VRML lighting model equations

Version:
$Revision: 1.9 $
Author:
Alan Hudson

Method Summary
 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()
          Accessor method to get current value of field shininess.
 float[] getSpecularColor()
          Accessor method to get current value of field specularColor.
 float getTransparency()
          Accessor method to get current value of field transparency.
 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)
          Accessor method to set a new value for field attribute transparency.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, getFieldValue, getMetadataObject, getRefCount, 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

public 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

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

Returns:
The current ambientIntensity

setDiffuseColor

public 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

public 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

public 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

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

Returns:
The current value of EmissiveColor

setShininess

public 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

public float getShininess()
Accessor method to get current value of field shininess. Default value is 0.2.

Returns:
The current value of Shininess

setSpecularColor

public 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

public float[] getSpecularColor()
Accessor method to get current value of field specularColor. Default value is 0 0 0.

Returns:
The current value of SpecularColor

setTransparency

public void setTransparency(float newTransparency)
                     throws InvalidFieldValueException
Accessor method to set a new value for field attribute transparency. How "clear" an object is: 1.0 is completely transparent, 0.0 is completely opaque .

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

getTransparency

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

Returns:
The current value of Transparency

setIgnoreDiffuse

public 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

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium