public class MatrixStack extends java.lang.Object implements Transformer
| Constructor and Description |
|---|
MatrixStack()
Creates new MatrixStack.
|
MatrixStack(MatrixStack clone)
Clone construcotr of MatrixStack
|
MatrixStack(org.apache.commons.math3.linear.RealMatrix current)
Creates new MatrixStack with starting matrix.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
apply(org.apache.commons.math3.geometry.euclidean.threed.Vector3D vec)
Called to transform a vector.
|
org.apache.commons.math3.linear.RealMatrix |
getMatrix()
Exposes current transformation matrix.
|
void |
loadIdentity()
Replaces current transformation matrix by an identity matrix.
|
MatrixStack |
loadMatrix(org.apache.commons.math3.linear.RealMatrix matrix)
Replaces current transformation matrix by an identity current.
|
MatrixStack |
popMatrix()
Pops matrix from stack.
|
MatrixStack |
pushMatrix()
Pushes matrix onto the stack.
|
MatrixStack |
rotate(org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation)
Rotates the current matrix
|
MatrixStack |
rotate(org.apache.commons.math3.geometry.euclidean.threed.Vector3D rotateVector,
double angle)
Rotates transformation matrix around rotateVector axis by angle radians.
|
MatrixStack |
scale(double x,
double y,
double z)
Scales current transformation matrix.
|
MatrixStack |
scale(org.apache.commons.math3.geometry.euclidean.threed.Vector3D scaleVector)
Scales current transformation matrix.
|
MatrixStack |
transform(org.apache.commons.math3.linear.RealMatrix matrix)
Transforms current matrix with give matrix.
|
MatrixStack |
translate(double x,
double y,
double z)
Translates current transformation matrix.
|
MatrixStack |
translate(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translateVector)
Translates current transformation matrix.
|
public MatrixStack()
public MatrixStack(MatrixStack clone)
clone - instance to be clonedpublic MatrixStack(org.apache.commons.math3.linear.RealMatrix current)
current - Transforation matrix to start from.public void loadIdentity()
public MatrixStack loadMatrix(org.apache.commons.math3.linear.RealMatrix matrix)
matrix - The new matrix to use.public org.apache.commons.math3.linear.RealMatrix getMatrix()
public MatrixStack transform(org.apache.commons.math3.linear.RealMatrix matrix)
matrix - to transform current matrix.public MatrixStack translate(double x, double y, double z)
x - translation.y - translation.z - translation.public MatrixStack translate(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translateVector)
translateVector - vector of translation.public MatrixStack rotate(org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation)
rotation - The rotation to aplypublic MatrixStack rotate(org.apache.commons.math3.geometry.euclidean.threed.Vector3D rotateVector, double angle)
rotateVector - Vector serving as rotation axis.angle - in radians.public MatrixStack scale(double x, double y, double z)
x - scale.y - scale.z - scale.public MatrixStack scale(org.apache.commons.math3.geometry.euclidean.threed.Vector3D scaleVector)
scaleVector - scale vector.public MatrixStack pushMatrix()
public MatrixStack popMatrix()
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D apply(org.apache.commons.math3.geometry.euclidean.threed.Vector3D vec)
apply in interface Transformervec - - The vector being transformed