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, scenepublic MatrixStackHelper(AbstractScene scn)
public void pushModelView()
MatrixHelperpushModelView in class MatrixHelperpublic void popModelView()
MatrixHelperpopModelView in class MatrixHelperpublic void resetModelView()
MatrixHelperresetModelView in class MatrixHelperpublic Mat modelView()
modelView in class MatrixHelperpublic Mat getModelView(Mat target)
MatrixHelpergetModelView in class MatrixHelperpublic void printModelView()
MatrixHelperprintModelView in class MatrixHelperpublic void setModelView(Mat source)
MatrixHelpersetModelView in class MatrixHelperpublic void applyModelView(Mat source)
MatrixHelperapplyModelView in class MatrixHelperpublic void translate(float tx,
float ty)
MatrixHelpertranslate in class MatrixHelperpublic void translate(float tx,
float ty,
float tz)
MatrixHelpertranslate in class MatrixHelperpublic void rotate(float angle)
MatrixHelperSame 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 MatrixHelperpublic void rotateX(float angle)
MatrixHelperrotateX in class MatrixHelperpublic void rotateY(float angle)
MatrixHelperrotateY in class MatrixHelperpublic void rotateZ(float angle)
MatrixHelperrotateZ in class MatrixHelperpublic void rotate(float angle,
float v0,
float v1,
float v2)
MatrixHelperrotate in class MatrixHelperpublic void scale(float s)
MatrixHelperscale in class MatrixHelperpublic void scale(float sx,
float sy)
MatrixHelperNot 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 MatrixHelperpublic void scale(float x,
float y,
float z)
MatrixHelperscale in class MatrixHelperpublic void pushProjection()
MatrixHelperpushProjection in class MatrixHelperpublic void popProjection()
MatrixHelperpopProjection in class MatrixHelperpublic void setProjection(Mat source)
MatrixHelpersetProjection in class MatrixHelperpublic void resetProjection()
MatrixHelperresetProjection in class MatrixHelperpublic void applyProjection(Mat source)
MatrixHelperapplyProjection in class MatrixHelperpublic Mat projection()
projection in class MatrixHelperpublic Mat getProjection(Mat target)
MatrixHelpergetProjection in class MatrixHelperpublic void printProjection()
MatrixHelperprintProjection in class MatrixHelperProcessing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia