|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmr3d.lang.MatrixFactory
The class MatrixFactory gives you several functions to create specialized matrices such as unit, rotation or translation matrices.
| Constructor Summary | |
MatrixFactory()
|
|
| Method Summary | |
static Matrix |
createMatrix(int type)
Creates a matrix of the specified type. |
static Matrix |
createRotMatrix(int xangle,
int yangle,
int zangle)
Creates a rotation matrix. |
static Matrix |
createScaleMatrix(int x,
int y,
int z)
Creates a scalation matrix. |
static Matrix |
createTransMatrix(int x,
int y,
int z)
Creates a 3D-translation matrix. |
protected static int |
toLinear(int line,
int column)
Transforms two-dimensional matrix coordinates into linear coordinates. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MatrixFactory()
| Method Detail |
public static Matrix createMatrix(int type)
Matrix. If a matrix type is
called that is not valid an error message will be displayed on
the console.
type - type constant of matrix
Matrix.TYPE_ZERO,
Matrix.TYPE_UNIT
public static Matrix createRotMatrix(int xangle,
int yangle,
int zangle)
If you multiply a 3D vector, which represents the coordinates of a 3D point with this matrix the point will be rotated about all coordinate axes for the given angle parameters. The following sequence will be used:
(1) rotation about the x-axis
(2) rotation about the y-axis
(3) rotation about the z-axis
The method parameter are angle values. Those values are defined as real angle value * 10. A 3D-point that is rotated by using this matrix will have coordinates 32.768 times greater than its actual value. This results from the scalation of the sinus funtion.
xangle - angle value * 10 to rotate about x-axisyangle - angle value * 10 to rotate about y-axiszangle - angle value * 10 to rotate about z-axis
Matrix,
MathME.sin(int),
MathME.cos(int)
public static Matrix createScaleMatrix(int x,
int y,
int z)
x - value of scalation in direction
of the x-axisy - value of scalation in direction
of the y-axisz - value of scalation in direction
of the z-axis
Matrix
public static Matrix createTransMatrix(int x,
int y,
int z)
If a 3D vector, that represents the coordinates of a 3D point, is multiplied with this translation matrix the point will move through its virtual world for the values given as parameters.
x - value of movement in direction
of the x-axisy - value of movement in direction
of the y-axisz - value of movement in direction
of the z-axis
Matrix
protected static int toLinear(int line,
int column)
line - line indexcolumn - column ndex
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||