| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.Texture javax.media.j3d.TextureCubeMap
TextureCubeMap | public class TextureCubeMap extends Texture (Code) | | 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:
- POSITIVE_X
- NEGATIVE_X
- POSITIVE_Y
- NEGATIVE_Y
- POSITIVE_Z
- NEGATIVE_Z
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.
See Also: Canvas3D.queryProperties since: Java 3D 1.3 |
Constructor Summary | |
public | TextureCubeMap() Constructs a texture object using default values. | public | TextureCubeMap(int mipmapMode, int format, int width) Constructs an empty TextureCubeMap object with specified mipmapMode
format, and width. | public | 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 | createRetained() Creates a retained mode TextureCubeMapRetained object that this
TextureCubeMap component object will point to. | public void | duplicateNodeComponent(NodeComponent originalNodeComponent) NOTE: Applications should not call this method directly. | public ImageComponent | getImage(int level, int face) Retrieves the image for a specified mipmap level of a particular
face of the cube map.
Parameters: level - mipmap level to get. Parameters: face - face of the cube map. | public ImageComponent | getImage(int level) This method is not supported for TextureCubeMap. | public ImageComponent[] | getImages(int face) Retrieves the array of images for all mipmap level of a particular
face of the cube map.
Parameters: face - face of the cube map. | public ImageComponent[] | getImages() This method is not supported for TextureCubeMap. | public void | setImage(int level, int face, ImageComponent2D image) Sets the image for a specified mipmap level of a specified face
of the cube map
Parameters: level - mipmap level Parameters: face - face of the cube map. | public void | setImage(int level, ImageComponent image) This method is not supported for TextureCubeMap. | public 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
Parameters: face - face of the cube map. | public void | setImages(ImageComponent[] images) This method is not supported for TextureCubeMap. |
NEGATIVE_X | final public static int NEGATIVE_X(Code) | | Specifies the face of the cube that is pierced by the negative x axis
|
NEGATIVE_Y | final public static int NEGATIVE_Y(Code) | | Specifies the face of the cube that is pierced by the negative y axis
|
NEGATIVE_Z | final public static int NEGATIVE_Z(Code) | | Specifies the face of the cube that is pierced by the negative z axis
|
POSITIVE_X | final public static int POSITIVE_X(Code) | | Specifies the face of the cube that is pierced by the positive x axis
|
POSITIVE_Y | final public static int POSITIVE_Y(Code) | | Specifies the face of the cube that is pierced by the positive y axis
|
POSITIVE_Z | final public static int POSITIVE_Z(Code) | | Specifies the face of the cube that is pierced by the positive z axis
|
TextureCubeMap | public TextureCubeMap()(Code) | | Constructs a texture object using default values.
Note that the default constructor creates a texture object with
a width of 0 and is, therefore, not useful.
|
TextureCubeMap | public TextureCubeMap(int mipmapMode, int format, int width)(Code) | | Constructs an empty TextureCubeMap object with specified mipmapMode
format, and width. Image at base level
must be set by
the application using 'setImage' method. If mipmapMode is
set to MULTI_LEVEL_MIPMAP, images for base level through maximum level
must be set.
Note that cube map is square in dimensions, hence specifying width
is sufficient.
Note also that a texture with a non-power-of-two width will
only be rendered on a graphics device that supports non-power-of-two
textures.
Parameters: mipmapMode - type of mipmap for this Texture: One ofBASE_LEVEL, MULTI_LEVEL_MIPMAP. Parameters: format - data format of Textures saved in this object.One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA. Parameters: width - width (and height) of image at level 0. exception: IllegalArgumentException - if width is not greaterthan 0 OR invalid format/mipmapMode is specified. |
TextureCubeMap | public TextureCubeMap(int mipmapMode, int format, int width, int boundaryWidth)(Code) | | Constructs an empty TextureCubeMap object with specified mipmapMode
format, width, and boundary width. Image at base level
must be set by
the application using 'setImage' method. If mipmapMode is
set to MULTI_LEVEL_MIPMAP, images for base level through maximum level
must be set.
Note that cube map is square in dimensions, hence specifying width
is sufficient.
Note also that a texture with a non-power-of-two width will
only be rendered on a graphics device that supports non-power-of-two
textures.
Parameters: mipmapMode - type of mipmap for this Texture: One ofBASE_LEVEL, MULTI_LEVEL_MIPMAP. Parameters: format - data format of Textures saved in this object.One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA. Parameters: width - width (and height) of image at level 0. Thisdoes not include the width of the boundary. Parameters: boundaryWidth - width of the boundary, which must be 0 or 1. exception: IllegalArgumentException - if width is notgreater than 0 OR invalid format/mipmapMode is specified. |
createRetained | void createRetained()(Code) | | Creates a retained mode TextureCubeMapRetained object that this
TextureCubeMap component object will point to.
|
duplicateNodeComponent | public void duplicateNodeComponent(NodeComponent originalNodeComponent)(Code) | | NOTE: Applications should not call this method directly.
It should only be called by the cloneNode method.
|
getImage | public ImageComponent getImage(int level, int face)(Code) | | Retrieves the image for a specified mipmap level of a particular
face of the cube map.
Parameters: level - mipmap level to get. Parameters: face - face of the cube map. One of: POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . the ImageComponent object containing the texture image atthe specified mipmap level. exception: IllegalArgumentException - if face has a value otherthan POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getImage | public ImageComponent getImage(int level)(Code) | | This method is not supported for TextureCubeMap.
A face of the cube map has to be specified when retrieving an image
for a particular level of the cube map.
exception: UnsupportedOperationException - this method is not supported since: Java 3D 1.3 |
getImages | public ImageComponent[] getImages(int face)(Code) | | Retrieves the array of images for all mipmap level of a particular
face of the cube map.
Parameters: face - face of the cube map. One of:POSITIVE_X , NEGATIVE_X ,POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . an array of ImageComponent object for the particular face ofof the cube map. exception: IllegalArgumentException - if face has a value otherthan POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getImages | public ImageComponent[] getImages()(Code) | | This method is not supported for TextureCubeMap.
A face of the cube map has to be specified when retrieving images
for the cube map.
exception: UnsupportedOperationException - this method is not supported since: Java 3D 1.3 |
setImage | public void setImage(int level, int face, ImageComponent2D image)(Code) | | Sets the image for a specified mipmap level of a specified face
of the cube map
Parameters: level - mipmap level Parameters: face - face of the cube map. One of: POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . Parameters: image - ImageComponent2D object containing the image exception: IllegalArgumentException - if face has a value otherthan POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: IllegalSharingException - if this TextureCubeMap is live andthe specified image is being used by a Canvas3D as an off-screen buffer. exception: IllegalSharingException - if this TextureCubeMap isbeing used by an immediate mode context andthe specified image is being used by a Canvas3D as an off-screen buffer. |
setImage | public void setImage(int level, ImageComponent image)(Code) | | This method is not supported for TextureCubeMap.
A face of the cube map has to be specified when setting an image
for a particular level of the cube map.
exception: UnsupportedOperationException - this method is not supported since: Java 3D 1.3 |
setImages | public void setImages(int face, ImageComponent2D[] images)(Code) | | Sets the array of images for mipmap levels from base level through
max level for a specified face of the cube map
Parameters: face - face of the cube map. One of: POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . Parameters: images - array of ImageComponent2D objects containing the images exception: IllegalArgumentException - if face has a value otherthan POSITIVE_X , NEGATIVE_X , POSITIVE_Y , NEGATIVE_Y ,POSITIVE_Z or NEGATIVE_Z . exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: IllegalSharingException - if this TextureCubeMap is live andany of the specified images are being used by a Canvas3D as anoff-screen buffer. exception: IllegalSharingException - if this TextureCubeMap isbeing used by an immediate mode context andany of the specified images are being used by a Canvas3D as anoff-screen buffer. |
setImages | public void setImages(ImageComponent[] images)(Code) | | This method is not supported for TextureCubeMap.
A face of the cube map has to be specified when setting images
for the cube map.
exception: UnsupportedOperationException - this method is not supported since: Java 3D 1.3 |
Fields inherited from javax.media.j3d.NodeComponent | boolean forceDuplicate(Code)(Java Doc)
|
|
|