|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.NodeComponent | +--javax.media.j3d.TextureAttributes
The TextureAttributes object defines attributes that apply to to texture mapping. The texture attributes include the following:
Appearance
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_COLOR_TABLE_READ
Specifies that this TextureAttributes object allows reading its texture color table component information. |
static int |
ALLOW_COLOR_TABLE_WRITE
Specifies that this TextureAttributes object allows writing its texture color table 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)
Constructs a TextureAttributes object with the specified values. |
Method Summary | |
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
int |
getNumTextureColorTableComponents()
Retrieves the number of color components in the current texture color table. |
int |
getPerspectiveCorrectionMode()
Gets perspective correction mode value. |
void |
getTextureBlendColor(Color4f textureBlendColor)
Gets the texture blend color for this appearance component object. |
void |
getTextureColorTable(int[][] table)
Retrieves the texture color table and copies it into the specified array. |
int |
getTextureColorTableSize()
Retrieves the size of the current texture color table. |
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 |
setTextureColorTable(int[][] table)
Sets the texture color table from the specified table. |
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 |
cloneNodeComponent,
duplicateNodeComponent,
duplicateNodeComponent,
getDuplicateOnCloneTree,
setDuplicateOnCloneTree |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability,
duplicateSceneGraphObject,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData,
updateNodeReferences |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ALLOW_MODE_READ
public static final int ALLOW_MODE_WRITE
public static final int ALLOW_BLEND_COLOR_READ
public static final int ALLOW_BLEND_COLOR_WRITE
public static final int ALLOW_TRANSFORM_READ
public static final int ALLOW_TRANSFORM_WRITE
public static final int ALLOW_COLOR_TABLE_READ
public static final int ALLOW_COLOR_TABLE_WRITE
public static final int FASTEST
public static final int NICEST
public static final int MODULATE
public static final int DECAL
public static final int BLEND
public static final int REPLACE
Constructor Detail |
public TextureAttributes()
public TextureAttributes(int textureMode, Transform3D transform, Color4f textureBlendColor, int perspCorrectionMode)
textureMode
- the texture mode; one of MODULATE
,
DECAL
, BLEND
, or REPLACE
transform
- the transform object, used to transform texture
coordinatestextureBlendColor
- the texture blend color, used when the
texture mode is BLEND
perspCorrectionMode
- the perspective correction mode to
be used for color and/or texture coordinate interpolation;
one of NICEST
or FASTEST
textureMode
is a value other than MODULATE
,
DECAL
, BLEND
, or REPLACE
FASTEST
or NICEST
.Method Detail |
public void setTextureMode(int textureMode)
textureMode
- the texture mode, one of: MODULATE
,
DECAL
, BLEND
, or REPLACE
textureMode
is a value other than MODULATE
,
DECAL
, BLEND
, or REPLACE
public int getTextureMode()
public void setTextureBlendColor(Color4f textureBlendColor)
textureBlendColor
- the texture blend color used when
the mode is BLEND
public void setTextureBlendColor(float r, float g, float b, float a)
BLEND
.r
- the red component of the colorg
- the green component of the colorb
- the blue component of the colora
- the alpha component of the colorpublic void getTextureBlendColor(Color4f textureBlendColor)
textureBlendColor
- the vector that will receive the texture
blend color used when the mode is BLENDpublic void setTextureTransform(Transform3D transform)
transform
- the new transform objectpublic void getTextureTransform(Transform3D transform)
transform
- the transform object that will receive the
current texture transformpublic void setPerspectiveCorrectionMode(int mode)
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.mode
- one of NICEST
or FASTEST
The default value is NICEST
.FASTEST
or NICEST
.public int getPerspectiveCorrectionMode()
public void setTextureColorTable(int[][] table)
table.length
defines the number of color
components and table[0].length
defines the texture
color table size. If the table is non-null, the number of
color components must either be 3, for rgb data, or 4,
for rgba data. The size of each array for each color
component must be the same and must be a power of 2. If table
is null or if the texture color table size is 0, the texture
color table is disabled. If the texture color table size is
greater than the device-dependent maximum texture color table
size for a particular Canvas3D, the texture color table is
ignored for that canvas.
When enabled, the texture color table is applied after the
texture filtering operation and before texture application.
Each of the r, g, b, and a
components are clamped to the range [0,1], multiplied by
textureColorTableSize-1
, and rounded to the
nearest integer. The resulting value for each component is
then used as an index into the respective table for that
component. If the texture color table contains 3 components,
alpha is passed through unmodified.
table
- the new texture color tabletable.length
is not 3 or 4, or if the arrays for each component are not all
the same length, or if the texture color table size
is not a power of 2Canvas3D.queryProperties()
public void getTextureColorTable(int[][] table)
table
- the array that will receive a copy of the
texture color table from this TextureAttributes object.
The array must be allocated by the caller and must be large
enough to hold the entire table (that is,
int[numTextureColorTableComponents][textureColorTableSize]
).public int getNumTextureColorTableComponents()
public int getTextureColorTableSize()
public NodeComponent cloneNodeComponent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |