m3g07
Class EmbossEffect

java.lang.Object
  extended by m3g07.EmbossEffect

public class EmbossEffect
extends java.lang.Object

Blends images to achieve an emboss effect.

Author:
Claus Hoefele
See Also:
EmbossingSample

Field Summary
private  float gap
          Strength of embossing effect.
private  javax.microedition.m3g.Mesh mesh
          Mesh for the emboss effect.
 
Constructor Summary
EmbossEffect(javax.microedition.m3g.Mesh mesh, javax.microedition.m3g.Image2D embossMap1, javax.microedition.m3g.Image2D embossMap2)
          Applies an emboss effect to a mesh.
 
Method Summary
 float getGap()
          Getter for gap.
 void invertGap()
          Inverts the distance between emboss images, thus switching between creating a bulge or a dent.
 void render(javax.microedition.m3g.Graphics3D graphics, javax.microedition.m3g.Transform transform)
          Renders the mesh with emboss effect.
 void setGap(float gap)
          Sets the strength of the embossing effect.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mesh

private javax.microedition.m3g.Mesh mesh
Mesh for the emboss effect.


gap

private float gap
Strength of embossing effect.

Constructor Detail

EmbossEffect

public EmbossEffect(javax.microedition.m3g.Mesh mesh,
                    javax.microedition.m3g.Image2D embossMap1,
                    javax.microedition.m3g.Image2D embossMap2)
Applies an emboss effect to a mesh. The mesh must have texture coordinates set in texture unit 0.

Parameters:
mesh - mesh for the emboss effect.
embossMap1 - emboss map.
embossMap2 - inverted version of embossMap1.
Method Detail

setGap

public void setGap(float gap)
Sets the strength of the embossing effect. A positive value will create an bulge; a negative value a dent.

Parameters:
gap - distance between emboss images.

getGap

public float getGap()
Getter for gap.

Returns:
distance between emboss images.

invertGap

public void invertGap()
Inverts the distance between emboss images, thus switching between creating a bulge or a dent.


render

public void render(javax.microedition.m3g.Graphics3D graphics,
                   javax.microedition.m3g.Transform transform)
Renders the mesh with emboss effect.

Parameters:
graphics - graphics context.
transform - mesh transformation.