m3g04.mesh
Class MeshFactory2D

java.lang.Object
  extended by m3g04.mesh.MeshFactory2D

public class MeshFactory2D
extends java.lang.Object

Factory methods for 2D meshes.

Author:
Claus Hoefele

Constructor Summary
private MeshFactory2D()
          Constructor has private access because class contains static methods exclusively.
 
Method Summary
static javax.microedition.m3g.Mesh createDisc(int slices)
          Creates a disc with radius one on the x-y plane.
static javax.microedition.m3g.Mesh createQuad(boolean addTexCoords)
          Creates a quad with a side length of two units on the x-y plane.
static javax.microedition.m3g.Mesh createTriangle()
          Creates a triangle on the x-y plane.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeshFactory2D

private MeshFactory2D()
Constructor has private access because class contains static methods exclusively.

Method Detail

createQuad

public static javax.microedition.m3g.Mesh createQuad(boolean addTexCoords)
Creates a quad with a side length of two units on the x-y plane. The quad's center is at the origin (0, 0, 0).

Parameters:
addTexCoords - true to generate texture coordinates, false otherwise.
Returns:
mesh.

createTriangle

public static javax.microedition.m3g.Mesh createTriangle()
Creates a triangle on the x-y plane. The tip of the triangle points in y direction.

Returns:
mesh.

createDisc

public static javax.microedition.m3g.Mesh createDisc(int slices)
Creates a disc with radius one on the x-y plane. The disc's center is at the origin (0, 0, 0).

Parameters:
slices - number of slices
Returns:
mesh.