artofillusion.texture
Class Texture2D

java.lang.Object
  extended by artofillusion.texture.Texture
      extended by artofillusion.texture.Texture2D
Direct Known Subclasses:
ImageMapTexture, ProceduralTexture2D

public abstract class Texture2D
extends Texture

Texture2D represents a Texture whose surface properties are defined in 2D. This 2D surface can be mapped onto a 3D object by a variety of different mappings.


Field Summary
 
Fields inherited from class artofillusion.texture.Texture
BUMP_COMPONENT, DIFFUSE_COLOR_COMPONENT, DISPLACEMENT_COMPONENT, EMISSIVE_COLOR_COMPONENT, HILIGHT_COLOR_COMPONENT, SPECULAR_COLOR_COMPONENT, TRANSPARENT_COLOR_COMPONENT
 
Constructor Summary
Texture2D()
           
 
Method Summary
 java.awt.Image createComponentImage(double minu, double maxu, double minv, double maxv, int width, int height, int component, double time, double[] param)
          Create an Image which represents a particular component of this texture.
 boolean displacementMapped()
          Determine whether the texture is displacement mapped based on the value returned by getDisplacement().
 TextureMapping getDefaultMapping(Object3D object)
          For the default mapping, use a basic projection.
 double getDisplacement(double x, double y, double xsize, double ysize, double t, double[] param)
          Textures which use displacement mapping should override this method to return the displacement at the given point.
abstract  void getTextureSpec(TextureSpec spec, double x, double y, double xsize, double ysize, double angle, double t, double[] param)
          Get the surface properties at point in the texture.
abstract  void getTransparency(RGBColor trans, double x, double y, double xsize, double ysize, double angle, double t, double[] param)
          Same as above, except only return the transparent color.
 
Methods inherited from class artofillusion.texture.Texture
assignNewID, duplicate, edit, getAverageSpec, getID, getName, getParameters, getTypeName, hasComponent, setID, setName, usesImage, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Texture2D

public Texture2D()
Method Detail

getTextureSpec

public abstract void getTextureSpec(TextureSpec spec,
                                    double x,
                                    double y,
                                    double xsize,
                                    double ysize,
                                    double angle,
                                    double t,
                                    double[] param)
Get the surface properties at point in the texture. The properties should be averaged over a region around the point.

Parameters:
spec - the surface properties will be stored in this
x - the x coordinate at which to evaluate the texture
y - the y coordinate at which to evaluate the texture
xsize - the range of x over which to average the surface properties
ysize - the range of z over which to average the surface properties
angle - the dot product of the view direction with the surface normal
t - the time at which to evaluate the surface properties
param - the texture parameter values at the point

getTransparency

public abstract void getTransparency(RGBColor trans,
                                     double x,
                                     double y,
                                     double xsize,
                                     double ysize,
                                     double angle,
                                     double t,
                                     double[] param)
Same as above, except only return the transparent color. This can save time in cases where only the transparency is required, for example, when tracing shadow rays.


getDefaultMapping

public TextureMapping getDefaultMapping(Object3D object)
For the default mapping, use a basic projection.

Specified by:
getDefaultMapping in class Texture

getDisplacement

public double getDisplacement(double x,
                              double y,
                              double xsize,
                              double ysize,
                              double t,
                              double[] param)
Textures which use displacement mapping should override this method to return the displacement at the given point.


displacementMapped

public boolean displacementMapped()
Determine whether the texture is displacement mapped based on the value returned by getDisplacement().


createComponentImage

public java.awt.Image createComponentImage(double minu,
                                           double maxu,
                                           double minv,
                                           double maxv,
                                           int width,
                                           int height,
                                           int component,
                                           double time,
                                           double[] param)
Create an Image which represents a particular component of this texture. The arguments specify the region of the texture to represent (U and V ranges), the image size, the component to represent (one of the constants defined in the Texture class), and the time and texture parameters.



Copyright © 1999-2011 by Peter Eastman.