Menu - Top - Home - Donate to Me

module:extras/matrixstack.MatrixStack

Back to documentation index.

new module:extras/matrixstack.MatrixStack()

This class implements a stack of 4x4 transformation matrices.

When the constructor is called, it will create a stack whose only element is the identity matrix.

Methods

module:extras/matrixstack~MatrixStack#frustum(l, r, b, t, n, f)

Modifies the matrix at the top of this stack by multiplying it by a frustum matrix.

For more information on the frustum matrix and the parameters, see MathUtil.mat4frustum.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#get()

Gets a copy of the matrix at the top of this stack.

Return Value

. (Type: Array.<number>)

module:extras/matrixstack~MatrixStack#loadIdentity()

Modifies the matrix at the top of this stack by replacing it with the identity matrix.

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#loadMatrix(mat)

Modifies the matrix at the top of this stack by replacing it with the given matrix.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#loadTransposeMatrix(mat)

Modifies the matrix at the top of this stack by replacing it with the transpose of the given matrix.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#lookAt(ex, ey, ez, cx, cy, cz, ux, uy, uz)

Modifies the matrix at the top of this stack by multiplying it by a matrix representing a "camera" view.

For more information on that matrix and the parameters, see MathUtil.mat4lookat.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#multMatrix(mat)

Modifies the matrix at the top of this stack by multiplying it by another matrix. The matrices are multiplied such that the transformations they describe happen in reverse order. For example, if the matrix at the top of the stack describes a translation and the matrix passed to this method describes a scaling, the multiplied matrix will describe the effect of scaling then translation.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#multTransposeMatrix(mat)

Modifies the matrix at the top of this stack by multiplying it by the transpose of another matrix. Both matrices are multiplied such that the transformation described by the top matrix "happens before" the transformation described by the matrix passed to this method. For example, if the matrix at the top of the stack describes a translation and the matrix passed to this method describes a scaling, the multiplied matrix will describe the effect of translation than scaling.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#ortho(l, r, b, t, n, f)

Modifies the matrix at the top of this stack by multiplying it by an orthographic projection matrix.

For more information on the projection matrix and the parameters, see MathUtil.mat4ortho.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#ortho2d(l, r, b, t)

Modifies the matrix at the top of this stack by multiplying it by a 2D orthographic projection matrix.

For more information on that matrix and the parameters, see MathUtil.mat4ortho2d.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#perspective(fov, aspect, n, f)

Modifies the matrix at the top of this stack by multiplying it by a matrix that defines a perspective projection.

For more information on that matrix and the parameters, see MathUtil.mat4perspective.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#pickMatrix(wx, wy, ww, wh, vp)

Modifies the matrix at the top of this stack by multiplying it by a matrix that transforms the view to a portion of the viewport.

For more information on that matrix and the parameters, see MathUtil.mat4pickMatrix.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#popMatrix()

Removes the matrix at the top of this stack, making the matrix beneath it the new top matrix. Has no effect if the stack has only one matrix.

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#pushMatrix()

Makes a copy of the matrix at the top of this stack and puts the copy on top of the stack.

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#rotate(angle, x, y, z)

Modifies the matrix at the top of this stack by multiplying it by a rotation transformation matrix. For more information on that matrix and the parameters, see MathUtil.mat4rotate.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#scale(x, y, z)

Modifies the matrix at the top of this stack by multiplying it by a scaling transformation.

Parameters

Return Value

This object. (Type: MatrixStack)

module:extras/matrixstack~MatrixStack#translate(x, y, z)

Modifies the matrix at the top of this stack by multiplying it by a translation transformation.

Parameters

Return Value

This object. (Type: MatrixStack)

Back to documentation index.