Class Transformation

java.lang.Object
  |
  +--Transformation

public class Transformation
extends Object

The representation of a transformation.

Author:
Sasmito Adibowo

Field Summary
protected  Jama.Matrix matrix
          The transformation matrix.
protected  String name
          The name of the transformation.
 
Constructor Summary
Transformation(String name, Jama.Matrix m)
          Constructs the transformation object.
 
Method Summary
static Jama.Matrix createRotateX(double degs)
          Create a rotation matrix around the X axis.
static Jama.Matrix createRotateX(double degs, double y, double z)
          Create a rotation matrix around a line parallel to the X axis.
static Jama.Matrix createRotateY(double degs)
          Create a rotation matrix around the Y axis.
static Jama.Matrix createRotateY(double degs, double x, double z)
          Create a rotation matrix around a line parallel to the Y axis
static Jama.Matrix createRotateZ(double degs)
          Create a rotation matrix around the Z axis.
static Jama.Matrix createRotateZ(double degs, double x, double y)
          Create a rotation matrix around a line parallel to the Z axis.
static Jama.Matrix createScale(double sx, double sy, double sz)
          Creates a scaling transformation matrix.
static Jama.Matrix createTranslation(double dx, double dy, double dz)
          Creates a translation transformation matrix.
 Jama.Matrix getMatrix()
          Returns the transformation matrix.
 String toString()
          Returns the name of the transformation.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

protected String name
The name of the transformation.

matrix

protected Jama.Matrix matrix
The transformation matrix.
Constructor Detail

Transformation

public Transformation(String name,
                      Jama.Matrix m)
Constructs the transformation object.
Parameters:
name - the name of the transformation
m - the transformation matrix.
Method Detail

toString

public String toString()
Returns the name of the transformation.
Overrides:
toString in class Object

getMatrix

public Jama.Matrix getMatrix()
Returns the transformation matrix.

createTranslation

public static Jama.Matrix createTranslation(double dx,
                                            double dy,
                                            double dz)
Creates a translation transformation matrix.
Parameters:
dx - the x-delta of the transformation.
dy - the y-delta of the transformation.
dz - the z-delta of the transformation.
Returns:
the 4x4 homogeneous translation matrix.

createScale

public static Jama.Matrix createScale(double sx,
                                      double sy,
                                      double sz)
Creates a scaling transformation matrix.
Parameters:
sx - the x-scale of the transformation.
sy - the y-scale of the transformation.
sz - the z-scale of the transformation.
Returns:
the 4x4 homogenous scaling matrix.

createRotateX

public static Jama.Matrix createRotateX(double degs)
Create a rotation matrix around the X axis.
Parameters:
degs - the rotation angle in degrees.
Returns:
the 4x4 homogeneous rotation matrix.

createRotateY

public static Jama.Matrix createRotateY(double degs)
Create a rotation matrix around the Y axis.
Parameters:
degs - the rotation angle in degrees.
Returns:
the 4x4 homogeneous rotation matrix.

createRotateZ

public static Jama.Matrix createRotateZ(double degs)
Create a rotation matrix around the Z axis.
Parameters:
degs - the rotation angle in degrees.
Returns:
the 4x4 homogeneous rotation matrix.

createRotateX

public static Jama.Matrix createRotateX(double degs,
                                        double y,
                                        double z)
Create a rotation matrix around a line parallel to the X axis.
Parameters:
degs - the rotation angle in degrees.
y - the y value of the line.
z - the z value of the line.
Returns:
the 4x4 homogeneous rotation matrix.

createRotateY

public static Jama.Matrix createRotateY(double degs,
                                        double x,
                                        double z)
Create a rotation matrix around a line parallel to the Y axis
Parameters:
degs - the rotation angle in degrees.
x - the x value of the line.
z - the z value of the line.
Returns:
the 4x4 homogeneous rotation matrix.

createRotateZ

public static Jama.Matrix createRotateZ(double degs,
                                        double x,
                                        double y)
Create a rotation matrix around a line parallel to the Z axis.
Parameters:
degs - the rotation angle in degrees.
x - the x value of the line.
y - the y value of the line.
Returns:
the 4x4 homogeneous rotation matrix.