public class MatrixStackHelper extends MatrixHelper
MatrixHelper
which attaches
to it a projection matrix stack and a modelview matrix stack.Constructor and Description |
---|
MatrixStackHelper(AbstractScene scn) |
Modifier and Type | Method and Description |
---|---|
void |
applyModelView(Mat source)
Multiplies the current modelview matrix by the one specified through the parameters.
|
void |
applyProjection(Mat source)
Multiplies the current projection matrix by the one specified through the parameters.
|
Mat |
getModelView(Mat target)
Copy the current modelview matrix into the specified target.
|
Mat |
getProjection(Mat target)
Copy the current projection matrix into the specified target.
|
Mat |
modelView() |
void |
popModelView()
Replace the current modelview matrix with the top of the stack.
|
void |
popProjection()
Replace the current projection matrix with the top of the stack.
|
void |
printModelView()
Print the current modelview matrix.
|
void |
printProjection()
Print the current projection matrix.
|
Mat |
projection() |
void |
pushModelView()
Push a copy of the modelview matrix onto the stack.
|
void |
pushProjection()
Push a copy of the projection matrix onto the stack.
|
void |
resetModelView()
Set the current modelview matrix to identity.
|
void |
resetProjection()
Set the current projection matrix to identity.
|
void |
rotate(float angle)
Two dimensional rotation.
|
void |
rotate(float angle,
float v0,
float v1,
float v2)
Rotate about a vector in space.
|
void |
rotateX(float angle)
Rotate around the X axis.
|
void |
rotateY(float angle)
Rotate around the Y axis.
|
void |
rotateZ(float angle)
Rotate around the Z axis.
|
void |
scale(float s)
Scale equally in all dimensions.
|
void |
scale(float sx,
float sy)
Scale in X and Y.
|
void |
scale(float x,
float y,
float z)
Scale in X, Y, and Z.
|
void |
setModelView(Mat source)
Set the current modelview matrix to the contents of another.
|
void |
setProjection(Mat source)
Set the current projection matrix to the contents of another.
|
void |
translate(float tx,
float ty)
Translate in X and Y.
|
void |
translate(float tx,
float ty,
float tz)
Translate in X, Y, and Z.
|
beginScreenDrawing, bind, bind, cacheProjectionViewInverse, endScreenDrawing, isProjectionViewInverseCached, loadModelView, loadModelView, loadProjection, loadProjection, projectionView, projectionViewInverse, scene
public MatrixStackHelper(AbstractScene scn)
public void pushModelView()
MatrixHelper
pushModelView
in class MatrixHelper
public void popModelView()
MatrixHelper
popModelView
in class MatrixHelper
public void resetModelView()
MatrixHelper
resetModelView
in class MatrixHelper
public Mat modelView()
modelView
in class MatrixHelper
public Mat getModelView(Mat target)
MatrixHelper
getModelView
in class MatrixHelper
public void printModelView()
MatrixHelper
printModelView
in class MatrixHelper
public void setModelView(Mat source)
MatrixHelper
setModelView
in class MatrixHelper
public void applyModelView(Mat source)
MatrixHelper
applyModelView
in class MatrixHelper
public void translate(float tx, float ty)
MatrixHelper
translate
in class MatrixHelper
public void translate(float tx, float ty, float tz)
MatrixHelper
translate
in class MatrixHelper
public void rotate(float angle)
MatrixHelper
Same as rotateZ (this is identical to a 3D rotation along the z-axis) but included for clarity. It'd be weird for people drawing 2D graphics to be using rotateZ. And they might kick our a-- for the confusion.
rotate
in class MatrixHelper
public void rotateX(float angle)
MatrixHelper
rotateX
in class MatrixHelper
public void rotateY(float angle)
MatrixHelper
rotateY
in class MatrixHelper
public void rotateZ(float angle)
MatrixHelper
rotateZ
in class MatrixHelper
public void rotate(float angle, float v0, float v1, float v2)
MatrixHelper
rotate
in class MatrixHelper
public void scale(float s)
MatrixHelper
scale
in class MatrixHelper
public void scale(float sx, float sy)
MatrixHelper
Not recommended for use in 3D, because the z-dimension is just scaled by 1, since there's no way to know what else to scale it by.
scale
in class MatrixHelper
public void scale(float x, float y, float z)
MatrixHelper
scale
in class MatrixHelper
public void pushProjection()
MatrixHelper
pushProjection
in class MatrixHelper
public void popProjection()
MatrixHelper
popProjection
in class MatrixHelper
public void setProjection(Mat source)
MatrixHelper
setProjection
in class MatrixHelper
public void resetProjection()
MatrixHelper
resetProjection
in class MatrixHelper
public void applyProjection(Mat source)
MatrixHelper
applyProjection
in class MatrixHelper
public Mat projection()
projection
in class MatrixHelper
public Mat getProjection(Mat target)
MatrixHelper
getProjection
in class MatrixHelper
public void printProjection()
MatrixHelper
printProjection
in class MatrixHelper
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia