javax.media.j3d
Class TextureAttributes

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.NodeComponent
              |
              +--javax.media.j3d.TextureAttributes

public class TextureAttributes
extends NodeComponent

The TextureAttributes object defines attributes that apply to to texture mapping.


Field Summary
static int ALLOW_BLEND_COLOR_READ
          Specifies that this TextureAttributes object allows reading its texture blend color component information.
static int ALLOW_BLEND_COLOR_WRITE
          Specifies that this TextureAttributes object allows writing its texture blend color component information.
static int ALLOW_MODE_READ
          Specifies that this TextureAttributes object allows reading its texture mode component information and perspective correction mode.
static int ALLOW_MODE_WRITE
          Specifies that this TextureAttributes object allows writing its texture mode component information and perspective correction mode.
static int ALLOW_TRANSFORM_READ
          Specifies that this TextureAttributes object allows reading its texture transform component information.
static int ALLOW_TRANSFORM_WRITE
          Specifies that this TextureAttributes object allows writing its texture transform component information.
static int BLEND
          Blend the texture blend color with the object color.
static int DECAL
          Apply the texture color to the object as a decal.
static int FASTEST
          Use the fastest available method for perspective correction.
static int MODULATE
          Modulate the object color with the texture color.
static int NICEST
          Use the nicest (highest quality) available method for texture mapping perspective correction.
static int REPLACE
          Replace the object color with the texture color.
 
Constructor Summary
TextureAttributes()
          Constructs a TextureAttributes object with default parameters.
TextureAttributes(int textureMode, Transform3D transform, Color4f textureBlendColor, int perspCorrectionMode)
          Construct a TextureAttributes with specified values.
 
Method Summary
 NodeComponent cloneNodeComponent()
          Creates a new TextureAttributes object.
 void duplicateNodeComponent(NodeComponent originalNodeComponent)
          Copies the information found in originalNodeComponent to the current node.
 int getPerspectiveCorrectionMode()
          Gets perspective correction mode value.
 void getTextureBlendColor(Color4f textureBlendColor)
          Gets the texture blend color for this appearance component object.
 int getTextureMode()
          Gets the texture mode parameter for this texture attributes object.
 void getTextureTransform(Transform3D transform)
          Retrieves a copy of the texture transform object.
 void setPerspectiveCorrectionMode(int mode)
          Sets perspective correction mode to be used for color and/or texture coordinate interpolation.
 void setTextureBlendColor(Color4f textureBlendColor)
          Sets the texture blend color for this texture attributes object.
 void setTextureBlendColor(float r, float g, float b, float a)
          Sets the texture blend color for this appearance component object.
 void setTextureMode(int textureMode)
          Sets the texture mode parameter for this appearance component object.
 void setTextureTransform(Transform3D transform)
          Sets the texture transform object used to transform texture coordinates.
 
Methods inherited from class javax.media.j3d.NodeComponent
getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_MODE_READ

public static final int ALLOW_MODE_READ
Specifies that this TextureAttributes object allows reading its texture mode component information and perspective correction mode.

ALLOW_MODE_WRITE

public static final int ALLOW_MODE_WRITE
Specifies that this TextureAttributes object allows writing its texture mode component information and perspective correction mode.

ALLOW_BLEND_COLOR_READ

public static final int ALLOW_BLEND_COLOR_READ
Specifies that this TextureAttributes object allows reading its texture blend color component information.

ALLOW_BLEND_COLOR_WRITE

public static final int ALLOW_BLEND_COLOR_WRITE
Specifies that this TextureAttributes object allows writing its texture blend color component information.

ALLOW_TRANSFORM_READ

public static final int ALLOW_TRANSFORM_READ
Specifies that this TextureAttributes object allows reading its texture transform component information.

ALLOW_TRANSFORM_WRITE

public static final int ALLOW_TRANSFORM_WRITE
Specifies that this TextureAttributes object allows writing its texture transform component information.

FASTEST

public static final int FASTEST
Use the fastest available method for perspective correction.

NICEST

public static final int NICEST
Use the nicest (highest quality) available method for texture mapping perspective correction.

MODULATE

public static final int MODULATE
Modulate the object color with the texture color.

DECAL

public static final int DECAL
Apply the texture color to the object as a decal.

BLEND

public static final int BLEND
Blend the texture blend color with the object color.

REPLACE

public static final int REPLACE
Replace the object color with the texture color.
Constructor Detail

TextureAttributes

public TextureAttributes()
Constructs a TextureAttributes object with default parameters. The default values are as follows:

TextureAttributes

public TextureAttributes(int textureMode,
                         Transform3D transform,
                         Color4f textureBlendColor,
                         int perspCorrectionMode)
Construct a TextureAttributes with specified values.
Method Detail

setTextureMode

public final void setTextureMode(int textureMode)
Sets the texture mode parameter for this appearance component object.
Parameters:
textureMode - the texture mode, one of: MODULATE, DECAL, BLEND, or REPLACE

getTextureMode

public final int getTextureMode()
Gets the texture mode parameter for this texture attributes object.
Returns:
textureMode the texture mode
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setTextureBlendColor

public final void setTextureBlendColor(Color4f textureBlendColor)
Sets the texture blend color for this texture attributes object.
Parameters:
textureBlendColor - the texture blend color used when the mode is BLEND
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setTextureBlendColor

public final void setTextureBlendColor(float r,
                                       float g,
                                       float b,
                                       float a)
Sets the texture blend color for this appearance component object. This color is used when the mode is BLEND.
Parameters:
r - the red component of the color
g - the green component of the color
b - the blue component of the color
a - the alpha component of the color
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTextureBlendColor

public final void getTextureBlendColor(Color4f textureBlendColor)
Gets the texture blend color for this appearance component object.
Parameters:
textureBlendColor - the vector that will receive the texture blend color used when the mode is BLEND
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setTextureTransform

public final void setTextureTransform(Transform3D transform)
Sets the texture transform object used to transform texture coordinates. A copy of the specified Transform3D object is stored in this TextureAttributes object.
Parameters:
transform - the new transform object
Throws:
CapabilityNotSetException - if the method is called when this object is part of live or compiled scene graph.

getTextureTransform

public final void getTextureTransform(Transform3D transform)
Retrieves a copy of the texture transform object.
Parameters:
transform - the transform object that will receive the current texture transform.
Throws:
CapabilityNotSetException - if the method is called when this object is part of live or compiled scene graph.

setPerspectiveCorrectionMode

public final void setPerspectiveCorrectionMode(int mode)
Sets perspective correction mode to be used for color and/or texture coordinate interpolation. A value of NICEST indicates that perspective correction should be performed and that the highest quality method should be used. A value of FASTEST indicates that the most efficient perspective correction method should be used.
Parameters:
mode - one of NICEST or FASTEST. The default value is NICEST.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
java.lang.IllegalArgumentException - if mode value is other than FASTEST or NICEST.

getPerspectiveCorrectionMode

public final int getPerspectiveCorrectionMode()
Gets perspective correction mode value.
Returns:
mode the value of perspective correction mode.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Creates a new TextureAttributes object. Called from a Leaf node's duplicateNode method.
Overrides:
cloneNodeComponent in class NodeComponent
Returns:
a duplicate of the TextureAttributes object.
See Also:
Node.duplicateNode(javax.media.j3d.Node, boolean), Node.cloneTree(), NodeComponent.setDuplicateOnCloneTree(boolean)

duplicateNodeComponent

public void duplicateNodeComponent(NodeComponent originalNodeComponent)
Copies the information found in originalNodeComponent to the current node. This routine is called as part of the cloneTree operation.
Overrides:
duplicateNodeComponent in class NodeComponent
Parameters:
originalNodeComponent - the node to duplicate.
See Also:
Node.cloneTree(), Node.duplicateNode(javax.media.j3d.Node, boolean), NodeComponent.setDuplicateOnCloneTree(boolean)