Class MatrixStack
Representa a stack for 4x4 matrices.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new MatrixStack.
|
Method Attributes | Method Name and Description |
---|---|
frustum(left, right, bottom, top, near, far)
Apply a frustum transformation to the matrix on top of this MatrixStack.
|
|
load(The)
Loads a matrix on top of this MatrixStack.
|
|
Loads the identity matrix on top of this MatrixStack.
|
|
lookAt(eye, direction, up)
Apply a lookAt transformation to the matrix on top of this MatrixStack.
|
|
multiply(The)
Multiplies a matrix with the one on top of this MatrixStack.
|
|
perspective(fovy, aspect, near, far)
Apply a perspective transformation to the matrix on top of this MatrixStack.
|
|
pop()
Pops the top matrix on top of this MatrixStack.
|
|
push()
Pushes a copy of the top matrix on this MatrixStack.
|
|
rotate(angle, x, y, z)
Apply a rotation to the matrix on top of this MatrixStack.
|
|
rotateXYZ(rx, ry, rz)
Apply a rotation to the matrix on top of this MatrixStack.
|
|
scale(x, y, z)
Apply a scale transformation to the matrix on top of this MatrixStack.
|
|
top()
Gets the matrix on top of this MatrixStack.
|
|
translate(x, y, z)
Apply a translation to the matrix on top of this MatrixStack.
|
Method Detail
{MatrixStack}
frustum(left, right, bottom, top, near, far)
Apply a frustum transformation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} left
- The left clipping plane.
- {Number} right
- The right clipping plane.
- {Number} bottom
- The bottom clipping plane.
- {Number} top
- The top clipping plane.
- {Number} near
- The near clipping plane.
- {Number} far
- The far clipping plane.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
load(The)
Loads a matrix on top of this MatrixStack.
- Parameters:
- {Matrix4} The
- matrix to load.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
loadIdentity()
Loads the identity matrix on top of this MatrixStack.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
lookAt(eye, direction, up)
Apply a lookAt transformation to the matrix on top of this MatrixStack.
- Parameters:
- {Vector3} eye
- The eye vector.
- {Vector3} direction
- The direction vector.
- {Vector3} up
- The up vector.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
multiply(The)
Multiplies a matrix with the one on top of this MatrixStack.
- Parameters:
- {Matrix4} The
- matrix to multiply with.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
perspective(fovy, aspect, near, far)
Apply a perspective transformation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} fovy
- The vertical field of view angle.
- {Number} aspect
- The aspect ratio aka the horizontal field of view angle.
- {Number} near
- The near clipping plane.
- {Number} far
- The far clipping plane.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
pop()
Pops the top matrix on top of this MatrixStack.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
push()
Pushes a copy of the top matrix on this MatrixStack.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
rotate(angle, x, y, z)
Apply a rotation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} angle
- The rotation angle.
- {Number} x
- The rotation axis x coordinate.
- {Number} y
- The rotation axis y coordinate.
- {Number} z
- The rotation axis z coordinate.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
rotateXYZ(rx, ry, rz)
Apply a rotation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} rx
- The rotation angle around X axis.
- {Number} ry
- The rotation angle around Y axis.
- {Number} rz
- The rotation angle around Z axis.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{MatrixStack}
scale(x, y, z)
Apply a scale transformation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} x
- The x scale factor.
- {Number} y
- The y scale factor.
- {Number} z
- The z scale factor.
- Returns:
- {MatrixStack} Returns this MatrixStack.
{Matrix4}
top()
Gets the matrix on top of this MatrixStack.
- Returns:
- {Matrix4} The matrix on top of the stack.
{MatrixStack}
translate(x, y, z)
Apply a translation to the matrix on top of this MatrixStack.
- Parameters:
- {Number} x
- The x translation factor.
- {Number} y
- The y translation factor.
- {Number} z
- The z translation factor.
- Returns:
- {MatrixStack} Returns this MatrixStack.