|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.Texture
javax.media.j3d.TextureCubeMap
public class TextureCubeMap
TextureCubeMap is a subclass of Texture class. It defines a special kind of texture mapping which is composed of a set of six 2D images representating the six faces of a cube. The texture coordinate (s,t,r) is used as a 3D direction vector emanating from the center of a cube to select a particular face of the cube based on the largest magnitude coordinate (the major axis). A new 2D texture coordinate (s,t) is then determined by dividing the other two coordinates (the minor axes) by the major axis value. The new coordinate is then used for texel lookup from the selected texture image of this cube map. The TextureCubeMap image is defined by specifying the images for each face of the cube. The cube map texture can be thought of as centered at the orgin of and aligned to an XYZ coordinate system. The names of the cube faces are:
Note that as of Java 3D 1.5, the texture width and height are no longer required to be an exact power of two. However, not all graphics devices supports non-power-of-two textures. If non-power-of-two texture mapping is unsupported on a particular Canvas3D, textures with a width or height that are not an exact power of two are ignored for that canvas.
Canvas3D.queryProperties()
Field Summary | |
---|---|
static int |
NEGATIVE_X
Specifies the face of the cube that is pierced by the negative x axis |
static int |
NEGATIVE_Y
Specifies the face of the cube that is pierced by the negative y axis |
static int |
NEGATIVE_Z
Specifies the face of the cube that is pierced by the negative z axis |
static int |
POSITIVE_X
Specifies the face of the cube that is pierced by the positive x axis |
static int |
POSITIVE_Y
Specifies the face of the cube that is pierced by the positive y axis |
static int |
POSITIVE_Z
Specifies the face of the cube that is pierced by the positive z axis |
Constructor Summary | |
---|---|
TextureCubeMap()
Constructs a texture object using default values. |
|
TextureCubeMap(int mipmapMode,
int format,
int width)
Constructs an empty TextureCubeMap object with specified mipmapMode format, and width. |
|
TextureCubeMap(int mipmapMode,
int format,
int width,
int boundaryWidth)
Constructs an empty TextureCubeMap object with specified mipmapMode format, width, and boundary width. |
Method Summary | |
---|---|
void |
duplicateNodeComponent(NodeComponent originalNodeComponent)
Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate) |
ImageComponent |
getImage(int level)
This method is not supported for TextureCubeMap. |
ImageComponent |
getImage(int level,
int face)
Retrieves the image for a specified mipmap level of a particular face of the cube map. |
ImageComponent[] |
getImages()
This method is not supported for TextureCubeMap. |
ImageComponent[] |
getImages(int face)
Retrieves the array of images for all mipmap level of a particular face of the cube map. |
void |
setImage(int level,
ImageComponent image)
This method is not supported for TextureCubeMap. |
void |
setImage(int level,
int face,
ImageComponent2D image)
Sets the image for a specified mipmap level of a specified face of the cube map |
void |
setImages(ImageComponent[] images)
This method is not supported for TextureCubeMap. |
void |
setImages(int face,
ImageComponent2D[] images)
Sets the array of images for mipmap levels from base level through max level for a specified face of the cube map |
Methods inherited from class javax.media.j3d.NodeComponent |
---|
cloneNodeComponent, cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree |
Methods inherited from class javax.media.j3d.SceneGraphObject |
---|
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int POSITIVE_X
public static final int NEGATIVE_X
public static final int POSITIVE_Y
public static final int NEGATIVE_Y
public static final int POSITIVE_Z
public static final int NEGATIVE_Z
Constructor Detail |
---|
public TextureCubeMap()
public TextureCubeMap(int mipmapMode, int format, int width)
mipmapMode
- type of mipmap for this Texture: One of
BASE_LEVEL, MULTI_LEVEL_MIPMAP.format
- data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA.width
- width (and height) of image at level 0.
java.lang.IllegalArgumentException
- if width is not greater
than 0 OR invalid format/mipmapMode is specified.public TextureCubeMap(int mipmapMode, int format, int width, int boundaryWidth)
mipmapMode
- type of mipmap for this Texture: One of
BASE_LEVEL, MULTI_LEVEL_MIPMAP.format
- data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA.width
- width (and height) of image at level 0. This
does not include the width of the boundary.boundaryWidth
- width of the boundary, which must be 0 or 1.
java.lang.IllegalArgumentException
- if width is not
greater than 0 OR invalid format/mipmapMode is specified.Method Detail |
---|
public void setImage(int level, int face, ImageComponent2D image)
level
- mipmap levelface
- face of the cube map. One of:
POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.image
- ImageComponent2D object containing the image
java.lang.IllegalArgumentException
- if
face
has a value other
than POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
IllegalSharingException
- if this TextureCubeMap is live and
the specified image is being used by a Canvas3D as an off-screen buffer.
IllegalSharingException
- if this TextureCubeMap is
being used by an immediate mode context and
the specified image is being used by a Canvas3D as an off-screen buffer.public void setImages(int face, ImageComponent2D[] images)
face
- face of the cube map. One of:
POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.images
- array of ImageComponent2D objects containing the images
java.lang.IllegalArgumentException
- if
face
has a value other
than POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
IllegalSharingException
- if this TextureCubeMap is live and
any of the specified images are being used by a Canvas3D as an
off-screen buffer.
IllegalSharingException
- if this TextureCubeMap is
being used by an immediate mode context and
any of the specified images are being used by a Canvas3D as an
off-screen buffer.public ImageComponent getImage(int level, int face)
level
- mipmap level to get.face
- face of the cube map. One of:
POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
java.lang.IllegalArgumentException
- if
face
has a value other
than POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic ImageComponent[] getImages(int face)
face
- face of the cube map. One of:
POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
java.lang.IllegalArgumentException
- if
face
has a value other
than POSITIVE_X
, NEGATIVE_X
,
POSITIVE_Y
, NEGATIVE_Y
,
POSITIVE_Z
or NEGATIVE_Z
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setImage(int level, ImageComponent image)
setImage
in class Texture
level
- mipmap level to set: 0 is the base levelimage
- ImageComponent object containing the texture image
for the specified mipmap level
java.lang.UnsupportedOperationException
- this method is not supportedpublic void setImages(ImageComponent[] images)
setImages
in class Texture
images
- array of ImageComponent objects
containing the texture images for all mipmap levels
java.lang.UnsupportedOperationException
- this method is not supportedpublic ImageComponent getImage(int level)
getImage
in class Texture
level
- mipmap level to get: 0 is the base level
java.lang.UnsupportedOperationException
- this method is not supportedpublic ImageComponent[] getImages()
getImages
in class Texture
java.lang.UnsupportedOperationException
- this method is not supportedpublic void duplicateNodeComponent(NodeComponent originalNodeComponent)
duplicateNodeComponent
in class NodeComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |