|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.texture.TextureMapping
artofillusion.texture.LayeredMapping
public class LayeredMapping
LayeredMapping is the TextureMapping corresponding to LayeredTextures. It allows multiple textures to be layered on top of each other. Most of the actual work is done by this class, rather than LayeredTexture.
Field Summary | |
---|---|
static int |
BLEND
|
static int |
OVERLAY_ADD_BUMPS
|
static int |
OVERLAY_BLEND_BUMPS
|
Fields inherited from class artofillusion.texture.TextureMapping |
---|
BACK_ONLY, FRONT_AND_BACK, FRONT_ONLY |
Constructor Summary | |
---|---|
LayeredMapping(Object3D obj,
Texture tex)
|
Method Summary | |
---|---|
void |
addLayer(int index,
Texture tex,
TextureMapping map,
int mode)
Add a layer to the texture. |
void |
addLayer(Texture tex)
Deprecated. Use addLayer(int, Texture, TextureMapping, int) instead. |
void |
copy(TextureMapping theMap)
Make this mapping identical to another one. |
void |
deleteLayer(int which)
Delete a layer from the texture. |
TextureMapping |
duplicate()
Create a new TextureMapping which is identical to this one. |
TextureMapping |
duplicate(Object3D obj,
Texture tex)
Create a new TextureMapping which is identical to this one, but for a different Texture. |
void |
getAverageSpec(TextureSpec spec,
double time,
double[] param)
Estimate the average surface properties by adding up the average properties of all of the layers. |
double |
getDisplacement(Vec3 pos,
double size,
double t,
double[] param)
Determine the displacement height by adding up all of the layers. |
Widget |
getEditingPanel(Object3D obj,
MaterialPreviewer preview)
There is no editing panel for layered mappings, since this is handled directly by the object texture dialog. |
Texture |
getLayer(int which)
Get a particular layer. |
TextureParameter |
getLayerBlendingParameter(int layer)
Get the parameter which specifies the blending fraction for a layer. |
TextureMapping |
getLayerMapping(int which)
Get the mapping for a particular layer. |
int |
getLayerMode(int which)
Get the blend mode for a particular layer. |
TextureParameter[] |
getLayerParameters(int which)
Get the list of texture parameters for a particular layer. |
Texture[] |
getLayers()
Get the list of layers for this texture. |
static java.lang.String |
getName()
|
int |
getNumLayers()
Get the number of layers. |
Object3D |
getObject()
Get the object this mapping is applied to. |
TextureParameter |
getParameterForLayer(TextureParameter parameter,
int layer)
Get the parameter corresponding to a parameter of one of the layer textures or mappings. |
TextureParameter[] |
getParameters()
Get the list of texture parameters. |
Texture |
getTexture()
Get the LayeredTexture object this mapping is associated with |
void |
getTextureSpec(Vec3 pos,
TextureSpec spec,
double angle,
double size,
double t,
double[] param)
Determine the surface properties by adding up the properties of all of the layers. |
void |
getTransparency(Vec3 pos,
RGBColor trans,
double angle,
double size,
double t,
double[] param)
Determine the transparency by adding up all of the layers. |
RenderingTriangle |
mapTriangle(int v1,
int v2,
int v3,
int n1,
int n2,
int n3,
Vec3[] vert)
Given the vertices to be mapped and their normal vectors, generate a RenderingTriangle. |
void |
moveLayer(int which,
int pos)
Move a layer to a new position. |
void |
readFromFile(java.io.DataInputStream in,
Scene theScene)
Loading and saving of layered mappings works a bit differently from other mappings, since it needs to refer other textures in the scene. |
void |
setLayer(int which,
Texture tex)
Set a particular layer. |
void |
setLayerMapping(int which,
TextureMapping map)
Set the mapping for a particular layer. |
void |
setLayerMode(int which,
int mode)
Set the blend mode for a particular layer. |
void |
setParameters(RenderingTriangle tri,
double[] p1,
double[] p2,
double[] p3,
RenderingMesh mesh)
This method is called once the texture parameters for the vertices of a triangle are known. |
void |
writeToFile(java.io.DataOutputStream out)
This form of writeToFile() is never used, and should never be called. |
void |
writeToFile(java.io.DataOutputStream out,
Scene theScene)
|
Methods inherited from class artofillusion.texture.TextureMapping |
---|
appliesTo, appliesToFace, setAppliesTo |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BLEND
public static final int OVERLAY_BLEND_BUMPS
public static final int OVERLAY_ADD_BUMPS
Constructor Detail |
---|
public LayeredMapping(Object3D obj, Texture tex)
Method Detail |
---|
public int getNumLayers()
public Texture[] getLayers()
public Texture getLayer(int which)
public void setLayer(int which, Texture tex)
public TextureMapping getLayerMapping(int which)
public void setLayerMapping(int which, TextureMapping map)
public int getLayerMode(int which)
public void setLayerMode(int which, int mode)
public TextureParameter[] getParameters()
getParameters
in class TextureMapping
public TextureParameter[] getLayerParameters(int which)
public TextureParameter getLayerBlendingParameter(int layer)
public TextureParameter getParameterForLayer(TextureParameter parameter, int layer)
A LayeredMapping creates a new TextureParameter corresponding to each parameter of its component Textures and TextureMappings. This is necessary because a single Texture might be used for multiple layers, so there must be multiple parameters corresponding to each parameter of that Texture.
parameter
- a parameter defined by a layer's Texture or TextureMappinglayer
- the layer for which to get the parameter
public void addLayer(Texture tex)
addLayer(int, Texture, TextureMapping, int)
instead.
public void addLayer(int index, Texture tex, TextureMapping map, int mode)
index
- the position at which the new layer should be added, where layer 0
is the topmost layer (the one visible over all others)tex
- the Texture of the new layermap
- the TextureMapping of the new layermode
- the blending mode of the new layer (BLEND
, OVERLAY_BLEND_BUMPS
,
or OVERLAY_ADD_BUMPS
)public void deleteLayer(int which)
public void moveLayer(int which, int pos)
public void readFromFile(java.io.DataInputStream in, Scene theScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
public void writeToFile(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
java.io.IOException
public void writeToFile(java.io.DataOutputStream out) throws java.io.IOException
writeToFile
in class TextureMapping
java.io.IOException
public static java.lang.String getName()
public RenderingTriangle mapTriangle(int v1, int v2, int v3, int n1, int n2, int n3, Vec3[] vert)
TextureMapping
mapTriangle
in class TextureMapping
public void setParameters(RenderingTriangle tri, double[] p1, double[] p2, double[] p3, RenderingMesh mesh)
setParameters
in class TextureMapping
public void getTextureSpec(Vec3 pos, TextureSpec spec, double angle, double size, double t, double[] param)
getTextureSpec
in class TextureMapping
pos
- the point at which to evaluate the texturespec
- the surface properties will be stored in thisangle
- the dot product of the view direction with the surface normalsize
- the width of the region over which to average the surface propertiest
- the time at which to evaluate the surface propertiesparam
- the texture parameter values at the pointpublic void getAverageSpec(TextureSpec spec, double time, double[] param)
public void getTransparency(Vec3 pos, RGBColor trans, double angle, double size, double t, double[] param)
getTransparency
in class TextureMapping
public double getDisplacement(Vec3 pos, double size, double t, double[] param)
getDisplacement
in class TextureMapping
public Texture getTexture()
getTexture
in class TextureMapping
public Object3D getObject()
TextureMapping
getObject
in class TextureMapping
public TextureMapping duplicate()
duplicate
in class TextureMapping
public TextureMapping duplicate(Object3D obj, Texture tex)
duplicate
in class TextureMapping
public void copy(TextureMapping theMap)
copy
in class TextureMapping
public Widget getEditingPanel(Object3D obj, MaterialPreviewer preview)
getEditingPanel
in class TextureMapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |