|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.j3d.threeD.raytracer.util.TransformMatrix
public class TransformMatrix
A TransformMatrix object represents a 4 X 4 matrix used for transforming vectors. A TransformMatrix object stores 16 double values for the matrix data and provides methods for transforming varius types of vectors. The TransformMatrix class also provides some static methods that generate certain useful matracies.
| Field Summary | |
|---|---|
static double[][] |
identity
The data for the identity matrix. |
static int |
TRANSFORM_AS_LOCATION
|
static int |
TRANSFORM_AS_NORMAL
|
static int |
TRANSFORM_AS_OFFSET
|
| Constructor Summary | |
|---|---|
TransformMatrix()
Constructs a TransformMatrix object that by default contains the data for a 4 X 4 identity matrix. |
|
TransformMatrix(double[][] matrix)
Constructs a TransformMatrix object with the specified matrix data. |
|
| Method Summary | |
|---|---|
TransformMatrix |
adjoint()
Computes the adjoint of the matrix represented by this TransformMatrix object and returns the result as a TransformMatrix object. |
void |
calculateInverse()
Calculates the inverse of the matrix represented by this TransformMatrix object and stores it for later use. |
static TransformMatrix |
createRotateXMatrix(double angle)
Generates a TransformMatrix object that can be used to rotate vectors counterclockwise about the x axis. |
static TransformMatrix |
createRotateYMatrix(double angle)
Generates a TransformMatrix object that can be used to rotate vectors counterclockwise about the y axis. |
static TransformMatrix |
createRotateZMatrix(double angle)
Generates a TransformMatrix object that can be used to rotate vectors counterclockwise about the z axis. |
static TransformMatrix |
createScaleMatrix(double sx,
double sy,
double sz)
Generates a TransformMatrix object that can be used to scale vectors using the specified scaling coefficients. |
static TransformMatrix |
createTranslationMatrix(double tx,
double ty,
double tz)
Generates a TransformMatrix object that can be used to translate vectors using the specified translation coordinates. |
double |
determinant()
Computes the determinant of the matrix represented by this TransformMatrix object and returns the result as a double value. |
TransformMatrix |
getInverse()
|
double[][] |
getInverseTransposeMatrix()
|
double[][] |
getMatrix()
|
TransformMatrix |
multiply(double value)
Multiplys the matrix represented by this TransformMatrix object with the specified double value and returns the result as a TransformMatrix object. |
TransformMatrix |
multiply(TransformMatrix matrix)
Multiplys the matrix represented by this TransformMatrix object with the matrix represented by the specified TransformMatrix object and returns the result as a TransformMatrix object. |
void |
setMatrix(double[][] matrix)
Sets the 16 values stored by this TransformMatrix to those specified. |
String |
toString()
|
TransformMatrix |
toUpperTriangle()
Converts the matrix represented by this TransformMatrix object to an upper triangle matrix and returns the result as a TransformMatrix object. |
double[] |
transform(double x,
double y,
double z,
int type)
|
void |
transform(Vector vector,
int type)
|
Vector |
transformAsLocation(Vector vector)
Computes and returns the result of the vector multiplication of the matrix represented by this TransformMatrix object and the vector represented by the specified Vector object assuming that the specified vector describes a location on 3d space. |
Vector |
transformAsNormal(Vector vector)
Computes and returns the result of the vector multiplication of the matrix represented by this TransformMatrix object and the vector represented by the specified Vector object assuming that the specified vector describes a surface normal in 3d space. |
Vector |
transformAsOffset(Vector vector)
Computes and returns the result of the vector multiplication of the matrix represented by this TransformMatrix object and the vector represented by the specified Vector object assuming that the specified vector describes an offset in 3d space. |
TransformMatrix |
transpose()
Computes the transpose of the matrix represented by this TransformMatrix object and returns the result as a TransformMatrix object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TRANSFORM_AS_LOCATION
public static final int TRANSFORM_AS_OFFSET
public static final int TRANSFORM_AS_NORMAL
public static final double[][] identity
| Constructor Detail |
|---|
public TransformMatrix()
public TransformMatrix(double[][] matrix)
| Method Detail |
|---|
public void setMatrix(double[][] matrix)
public double[][] getMatrix()
public double[][] getInverseTransposeMatrix()
public TransformMatrix multiply(double value)
public TransformMatrix multiply(TransformMatrix matrix)
public void transform(Vector vector,
int type)
public double[] transform(double x,
double y,
double z,
int type)
public Vector transformAsLocation(Vector vector)
public Vector transformAsOffset(Vector vector)
public Vector transformAsNormal(Vector vector)
public void calculateInverse()
public TransformMatrix getInverse()
public double determinant()
public TransformMatrix transpose()
public TransformMatrix adjoint()
public TransformMatrix toUpperTriangle()
public String toString()
toString in class Object
public static TransformMatrix createTranslationMatrix(double tx,
double ty,
double tz)
public static TransformMatrix createScaleMatrix(double sx,
double sy,
double sz)
public static TransformMatrix createRotateXMatrix(double angle)
public static TransformMatrix createRotateYMatrix(double angle)
public static TransformMatrix createRotateZMatrix(double angle)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||