|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.texture.TextureMapping
artofillusion.texture.Mapping2D
artofillusion.texture.ProjectionMapping
public class ProjectionMapping
ProjectionMapping is a Mapping2D which projects the texture along a specified direction.
Field Summary |
---|
Fields inherited from class artofillusion.texture.TextureMapping |
---|
BACK_ONLY, FRONT_AND_BACK, FRONT_ONLY |
Constructor Summary | |
---|---|
ProjectionMapping(java.io.DataInputStream in,
Object3D theObject,
Texture theTexture)
|
|
ProjectionMapping(Object3D theObject,
Texture theTexture)
|
Method Summary | |
---|---|
void |
copy(TextureMapping mapping)
Make this mapping identical to another one. |
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 object and texture. |
Vec2[] |
findTextureCoordinates(Mesh mesh)
Given a Mesh to which this mapping has been applied, return the texture coordinates at each vertex. |
Vec2 |
getCenter()
Get a vector whose components contain the center position for the mapping. |
double |
getDisplacement(Vec3 pos,
double size,
double time,
double[] param)
Given a point on the surface, evaluate the displacement function. |
Widget |
getEditingPanel(Object3D obj,
MaterialPreviewer preview)
This method should return a Widget in which the user can edit the mapping. |
static java.lang.String |
getName()
|
TextureParameter[] |
getParameters()
Get the list of texture parameters associated with this mapping and its texture. |
Vec3 |
getRotations()
Get a vector whose components contain the rotation angles for the mapping. |
Vec2 |
getScale()
Get a vector whose components contain the scale factors for the mapping. |
void |
getTextureSpec(Vec3 pos,
TextureSpec spec,
double angle,
double size,
double time,
double[] param)
Given a point on the surface for which this mapping is being used, find the corresponding surface properties. |
Mat4 |
getTransform()
Get a matrix which can be used to transform object coordinates to texture coordinates. |
void |
getTransparency(Vec3 pos,
RGBColor trans,
double angle,
double size,
double time,
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). |
boolean |
isScaledToObject()
Get whether the texture is scaled based on the size of the object. |
RenderingTriangle |
mapTriangle(int v1,
int v2,
int v3,
int n1,
int n2,
int n3,
Vec3[] vert)
Create a rendering triangle with this mapping. |
void |
setBoundToSurface(boolean bound)
Set whether this texture is bound to the surface (texture coordinates are determined by parameters, not by position). |
void |
setCenter(Vec2 center)
Set the center position for the mapping. |
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 |
setRotations(Vec3 angles)
Set the rotation angles for the mapping. |
void |
setScale(Vec2 scale)
Set the scale factors for the mapping. |
void |
setScaledToObject(boolean scaled)
Set whether the texture is scaled based on the size of the object. |
void |
writeToFile(java.io.DataOutputStream out)
Every subclass of TextureMapping must define a constructor which takes a Texture and an Object3D as its arguments: |
Methods inherited from class artofillusion.texture.Mapping2D |
---|
getObject, getTexture, legalMapping |
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 |
Constructor Detail |
---|
public ProjectionMapping(Object3D theObject, Texture theTexture)
public ProjectionMapping(java.io.DataInputStream in, Object3D theObject, Texture theTexture) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
Method Detail |
---|
public static java.lang.String getName()
public Vec2 getCenter()
public void setCenter(Vec2 center)
public Vec2 getScale()
public void setScale(Vec2 scale)
public Vec3 getRotations()
public void setRotations(Vec3 angles)
public boolean isBoundToSurface()
public void setBoundToSurface(boolean bound)
public boolean isScaledToObject()
public void setScaledToObject(boolean scaled)
public Mat4 getTransform()
public RenderingTriangle mapTriangle(int v1, int v2, int v3, int n1, int n2, int n3, Vec3[] vert)
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 time, double[] param)
TextureMapping
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 propertiestime
- the time at which to evaluate the surface propertiesparam
- the texture parameter values at the pointpublic void getTransparency(Vec3 pos, RGBColor trans, double angle, double size, double time, double[] param)
TextureMapping
getTransparency
in class TextureMapping
public double getDisplacement(Vec3 pos, double size, double time, double[] param)
TextureMapping
getDisplacement
in class TextureMapping
public Vec2[] findTextureCoordinates(Mesh mesh)
findTextureCoordinates
in class Mapping2D
public TextureMapping duplicate()
TextureMapping
duplicate
in class TextureMapping
public TextureMapping duplicate(Object3D obj, Texture tex)
TextureMapping
duplicate
in class TextureMapping
public void copy(TextureMapping mapping)
TextureMapping
copy
in class TextureMapping
public TextureParameter[] getParameters()
getParameters
in class TextureMapping
public Widget getEditingPanel(Object3D obj, MaterialPreviewer preview)
TextureMapping
getEditingPanel
in class TextureMapping
public void writeToFile(java.io.DataOutputStream out) throws java.io.IOException
TextureMapping
public MappingSubclass(Object3D obj, Texture texture)
In addition, every subclass must include a method of the form
public static boolean legalMapping(Object3D obj, Texture texture)
which returns true if the mapping can be used with the specified object and Texture. Finally, every subclass must include a constructor with the signature
public MappingSubclass(DataInputStream in, Object3D obj, Texture texture) throws IOException, InvalidObjectException
which reconstructs the mapping by reading its data from an input stream. The following method writes the object's data to an output stream.
writeToFile
in class TextureMapping
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |