de.fhpotsdam.unfolding.texture
Class TextureDistorter

java.lang.Object
  extended by de.fhpotsdam.unfolding.texture.TextureDistorter

public class TextureDistorter
extends java.lang.Object


Field Summary
protected  processing.core.PVector[][] distortedGrid
           
 Distorter distorter
           
 float lightX
           
 float lightY
           
protected  int meshHeight
           
protected  int meshStep
           
protected  int meshWidth
           
 boolean mouse3DRotate
           
protected  java.util.ArrayList<processing.core.PVector> normals
           
protected  processing.core.PVector[][] origGrid
           
 boolean osc3DRotate
           
 float rotX
           
 float rotY
           
 float rotZ
           
 boolean showLight
           
protected  java.util.ArrayList<processing.core.PVector> texCoords
           
protected  int uSteps
           
protected  java.util.ArrayList<processing.core.PVector> vertices
           
protected  int vSteps
           
 
Constructor Summary
TextureDistorter(processing.core.PApplet papplet, float width, float height, int meshStep)
           
TextureDistorter(processing.core.PApplet p, int meshWidth, int meshHeight, int meshStep)
           
 
Method Summary
protected  void addVertex(float x, float y, float z, float u, float v)
          Adds vertex, texture coordinates, and normals.
protected  void createMesh(processing.core.PVector[][] grid)
           
protected  void distortGrid()
           
protected  void distortGridByTexture(processing.core.PImage texture)
           
protected  void distortMesh()
           
protected  void distortVertex(float x, float y, float z, float u, float v)
           
 void draw(processing.core.PGraphics g, processing.core.PImage texture)
           
protected  void initGrids()
           
 void setDistorter(Distorter distorter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mouse3DRotate

public boolean mouse3DRotate

osc3DRotate

public boolean osc3DRotate

lightX

public float lightX

lightY

public float lightY

meshWidth

protected int meshWidth

meshHeight

protected int meshHeight

meshStep

protected int meshStep

distorter

public Distorter distorter

uSteps

protected int uSteps

vSteps

protected int vSteps

origGrid

protected processing.core.PVector[][] origGrid

distortedGrid

protected processing.core.PVector[][] distortedGrid

vertices

protected java.util.ArrayList<processing.core.PVector> vertices

texCoords

protected java.util.ArrayList<processing.core.PVector> texCoords

normals

protected java.util.ArrayList<processing.core.PVector> normals

rotX

public float rotX

rotY

public float rotY

rotZ

public float rotZ

showLight

public boolean showLight
Constructor Detail

TextureDistorter

public TextureDistorter(processing.core.PApplet p,
                        int meshWidth,
                        int meshHeight,
                        int meshStep)

TextureDistorter

public TextureDistorter(processing.core.PApplet papplet,
                        float width,
                        float height,
                        int meshStep)
Method Detail

setDistorter

public void setDistorter(Distorter distorter)

draw

public void draw(processing.core.PGraphics g,
                 processing.core.PImage texture)

initGrids

protected void initGrids()

distortGridByTexture

protected void distortGridByTexture(processing.core.PImage texture)

distortGrid

protected void distortGrid()

createMesh

protected void createMesh(processing.core.PVector[][] grid)

distortMesh

protected void distortMesh()

distortVertex

protected void distortVertex(float x,
                             float y,
                             float z,
                             float u,
                             float v)

addVertex

protected void addVertex(float x,
                         float y,
                         float z,
                         float u,
                         float v)
Adds vertex, texture coordinates, and normals.