artofillusion.texture
Class NonlinearMapping2D

java.lang.Object
  extended by artofillusion.texture.TextureMapping
      extended by artofillusion.texture.Mapping2D
          extended by artofillusion.texture.NonlinearMapping2D
Direct Known Subclasses:
CylindricalMapping, SphericalMapping

public abstract class NonlinearMapping2D
extends Mapping2D

NonlinearMapping2D is an abstract class describing a nonlinear mapping between 2D texture coordinates and 3D space. When called on to map a triangle, it first performs any initial linear transformations on the triangle vertices to yield 3-dimensional "intermediate texture coordinates." It then provides a callback function which takes an intermediate texture coordinate and performs the final nonlinear mapping to yield a 2D texture coordinate.


Field Summary
 
Fields inherited from class artofillusion.texture.TextureMapping
BACK_ONLY, FRONT_AND_BACK, FRONT_ONLY
 
Constructor Summary
NonlinearMapping2D(Object3D theObject, Texture theTexture)
           
 
Method Summary
abstract  double getDisplaceIntermed(double x, double y, double z, double size, double t, double[] param)
          Same as above, except only return the displacement.
abstract  Mat4 getPreTransform()
          Get the linear transform which maps from object coordinates to intermediate coordinates.
abstract  void getSpecIntermed(TextureSpec spec, double x, double y, double z, double size, double angle, double t, double[] param)
          Given intermediate texture coordinates, find the surface properties.
abstract  void getTransIntermed(RGBColor trans, double x, double y, double z, double size, double angle, double t, double[] param)
          Same as above, except only return the transparent color.
 boolean isBoundToSurface()
          Determine whether this texture is bound to the surface (texture coordinates are determined by parameters, not by position).
 void setBoundToSurface(boolean bound)
          Set whether this texture is bound to the surface (texture coordinates are determined by parameters, not by position).
 
Methods inherited from class artofillusion.texture.Mapping2D
findTextureCoordinates, getObject, getTexture, legalMapping
 
Methods inherited from class artofillusion.texture.TextureMapping
appliesTo, appliesToFace, copy, duplicate, duplicate, getDisplacement, getEditingPanel, getName, getParameters, getTextureSpec, getTransparency, mapTriangle, setAppliesTo, setParameters, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonlinearMapping2D

public NonlinearMapping2D(Object3D theObject,
                          Texture theTexture)
Method Detail

getPreTransform

public abstract Mat4 getPreTransform()
Get the linear transform which maps from object coordinates to intermediate coordinates.


getSpecIntermed

public abstract void getSpecIntermed(TextureSpec spec,
                                     double x,
                                     double y,
                                     double z,
                                     double size,
                                     double angle,
                                     double t,
                                     double[] param)
Given intermediate texture coordinates, find the surface properties. size is the width of the area over which the properties should be averaged.


getTransIntermed

public abstract void getTransIntermed(RGBColor trans,
                                      double x,
                                      double y,
                                      double z,
                                      double size,
                                      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.


getDisplaceIntermed

public abstract double getDisplaceIntermed(double x,
                                           double y,
                                           double z,
                                           double size,
                                           double t,
                                           double[] param)
Same as above, except only return the displacement.


isBoundToSurface

public boolean isBoundToSurface()
Determine whether this texture is bound to the surface (texture coordinates are determined by parameters, not by position).


setBoundToSurface

public void setBoundToSurface(boolean bound)
Set whether this texture is bound to the surface (texture coordinates are determined by parameters, not by position).



Copyright © 1999-2011 by Peter Eastman.