javax.media.j3d

## Class Texture3D

- java.lang.Object
- - javax.media.j3d.SceneGraphObject
  - - javax.media.j3d.NodeComponent
    - - javax.media.j3d.Texture
      - - javax.media.j3d.Texture3D

-     public class Texture3D
      extends Texture

  Texture3D is a subclass of Texture class. It extends Texture class by adding a third coordinate, constructor and a mutator method for setting a 3D texture image. If 3D texture mapping is not supported on a particular Canvas3D, 3D texture mapping is ignored for that canvas.

  Note that as of Java 3D 1.5, the texture width, height, and depth 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, height, or depth that are not an exact power of two are ignored for that canvas.

  See Also:
    `Canvas3D.queryProperties()`

- - ### Field Summary

    - ### Fields inherited from class javax.media.j3d.Texture

      `ALLOW_ANISOTROPIC_FILTER_READ, ALLOW_BOUNDARY_COLOR_READ, ALLOW_BOUNDARY_MODE_READ, ALLOW_ENABLE_READ, ALLOW_ENABLE_WRITE, ALLOW_FILTER_READ, ALLOW_FILTER4_READ, ALLOW_FORMAT_READ, ALLOW_IMAGE_READ, ALLOW_IMAGE_WRITE, ALLOW_LOD_RANGE_READ, ALLOW_LOD_RANGE_WRITE, ALLOW_MIPMAP_MODE_READ, ALLOW_SHARPEN_TEXTURE_READ, ALLOW_SIZE_READ, ALPHA, ANISOTROPIC_NONE, ANISOTROPIC_SINGLE_VALUE, BASE_LEVEL, BASE_LEVEL_LINEAR, BASE_LEVEL_POINT, CLAMP, CLAMP_TO_BOUNDARY, CLAMP_TO_EDGE, FASTEST, FILTER4, INTENSITY, LINEAR_SHARPEN, LINEAR_SHARPEN_ALPHA, LINEAR_SHARPEN_RGB, LUMINANCE, LUMINANCE_ALPHA, MULTI_LEVEL_LINEAR, MULTI_LEVEL_MIPMAP, MULTI_LEVEL_POINT, NICEST, RGB, RGBA, WRAP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Texture3D()` Constructs a Texture3D object with default parameters.
    `Texture3D(int mipmapMode, int format, int width, int height, int depth)` Constructs an empty Texture3D object with specified mipmapMode format, width, height, and depth.
    `Texture3D(int mipmapMode, int format, int width, int height, int depth, int boundaryWidth)` Constructs an empty Texture3D object with specified mipmapMode format, width, height, depth, and boundaryWidth.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `NodeComponent` | `cloneNodeComponent()` Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)
    `void` | `duplicateNodeComponent(NodeComponent originalNodeComponent)` Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)
    `int` | `getBoundaryModeR()` Retrieves the boundary mode for the R coordinate.
    `int` | `getDepth()` Retrieves the depth of this Texture3D object.
    `void` | `setBoundaryModeR(int boundaryModeR)` Sets the boundary mode for the R coordinate in this texture object.

    - ### Methods inherited from class javax.media.j3d.Texture

      `getAnisotropicFilterDegree, getAnisotropicFilterMode, getBaseLevel, getBoundaryColor, getBoundaryModeS, getBoundaryModeT, getBoundaryWidth, getEnable, getFilter4Func, getFilter4FuncPointsCount, getFormat, getHeight, getImage, getImages, getLodOffset, getMagFilter, getMaximumLevel, getMaximumLOD, getMinFilter, getMinimumLOD, getMipMapMode, getSharpenTextureFunc, getSharpenTextureFunc, getSharpenTextureFuncPointsCount, getWidth, numMipMapLevels, setAnisotropicFilterDegree, setAnisotropicFilterMode, setBaseLevel, setBoundaryColor, setBoundaryColor, setBoundaryModeS, setBoundaryModeT, setEnable, setFilter4Func, setImage, setImages, setLodOffset, setLodOffset, setMagFilter, setMaximumLevel, setMaximumLOD, setMinFilter, setMinimumLOD, setMipMapMode, setSharpenTextureFunc, setSharpenTextureFunc`

    - ### Methods inherited from class javax.media.j3d.NodeComponent

      `cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree`

    - ### Methods inherited from class javax.media.j3d.SceneGraphObject

      `clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Texture3D

          public Texture3D()

      Constructs a Texture3D object with default parameters. The default values are as follows:
      depth : 0
      boundary mode R : WRAP

      Note that the default constructor creates a texture object with a width, height, and depth of 0 and is, therefore, not useful.

    - #### Texture3D

          public Texture3D(int mipmapMode,
                   int format,
                   int width,
                   int height,
                   int depth)

      Constructs an empty Texture3D object with specified mipmapMode format, width, height, and depth. 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 a texture with a non-power-of-two width, height, or depth will only be rendered on a graphics device that supports non-power-of-two textures.
      Parameters:
        `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 of image at level 0.
        `height` - height of image at level 0.
        `depth` - depth of image at level 0.
      Throws:
        `java.lang.IllegalArgumentException` - if width, height, or depth are not greater than 0 OR invalid format/mipmapMode is specified.

    - #### Texture3D

          public Texture3D(int mipmapMode,
                   int format,
                   int width,
                   int height,
                   int depth,
                   int boundaryWidth)

      Constructs an empty Texture3D object with specified mipmapMode format, width, height, depth, and boundaryWidth. 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 a texture with a non-power-of-two width, height, or depth will only be rendered on a graphics device that supports non-power-of-two textures.
      Parameters:
        `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 of image at level 0. This does not include the width of the boundary.
        `height` - height of image at level 0. This does not include the width of the boundary.
        `depth` - depth 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.
      Throws:
        `java.lang.IllegalArgumentException` - if width, height, or depth are not greater than 0 OR invalid format/mipmapMode is specified, or if the boundaryWidth is < 0 or > 1
      Since:
        Java 3D 1.3

  - ### Method Detail

    - #### setBoundaryModeR

          public void setBoundaryModeR(int boundaryModeR)

      Sets the boundary mode for the R coordinate in this texture object.
      Parameters:
        `boundaryModeR` - the boundary mode for the R coordinate, one of: CLAMP, WRAP, CLAMP_TO_EDGE, or CLAMP_TO_BOUNDARY
      Throws:
        `RestrictedAccessException` - if the method is called when this object is part of live or compiled scene graph.
        `java.lang.IllegalArgumentException` - if `boundaryModeR` is a value other than `CLAMP`, `WRAP`, `CLAMP_TO_EDGE`, or `CLAMP_TO_BOUNDARY`.

    - #### getBoundaryModeR

          public int getBoundaryModeR()

      Retrieves the boundary mode for the R coordinate.
      Returns:
        the current boundary mode for the R coordinate.
      Throws:
        `RestrictedAccessException` - if the method is called when this object is part of live or compiled scene graph.

    - #### getDepth

          public int getDepth()

      Retrieves the depth of this Texture3D object.
      Returns:
        the depth of this Texture3D object.
      Throws:
        `CapabilityNotSetException` - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
        Java 3D 1.2

    - #### cloneNodeComponent

          public NodeComponent cloneNodeComponent()

      Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)
      Overrides:
        `cloneNodeComponent` in class `NodeComponent`

    - #### duplicateNodeComponent

          public void duplicateNodeComponent(NodeComponent originalNodeComponent)

      Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)
      NOTE: Applications should not call this method directly. It should only be called by the cloneNode method.
      Overrides:
        `duplicateNodeComponent` in class `NodeComponent`

Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.