Matrix Class
Matrix class
Constructor
Matrix
()
Item Index
Methods
frustum
-
l -
r -
b -
t -
n -
f
Sets up a viewing frustum, which is shaped like a truncated pyramid with the camera where the point of the pyramid would be. This emulates the OpenGL
Parameters:
-
lFloatLeft
-
rFloatRight
-
bFloatBottom
-
tFloatTop
-
nFloatNear
-
fFloatFar
Returns:
Result matrix
inverse
()
Matrix
Returns the matrix that when multiplied with this matrix results in the identity matrix.
Returns:
Inverted matrix
lookAt
-
e -
c -
u
Create a matrix that puts the camera at the eye point ex, ey, ez looking
toward the center point cx, cy, cz with an up direction of ux, uy, uz.
Returns:
Result matrix
multiply
-
matrix
Concatenates the transforms for this matrix and matrix.
Parameters:
-
matrixMatrixMatrix to multiply
Returns:
Multiplied matrix
ortho
-
l -
r -
b -
t -
n -
f
Creates an orthographic projection, in which objects are the same size no matter how far away or nearby they are.
Parameters:
-
lFloatLeft
-
rFloatRight
-
bFloatBottom
-
tFloatTop
-
nFloatNear
-
fFloatFar
Returns:
Result matrix
orthoPerspective
-
fov -
aspect -
near -
far
Sets up an ortho perspective transform. The aspect argument is the width divided by the height
of your viewport and fov is the top-to-bottom angle of the field of view in
degrees.
Parameters:
-
fovFloatField of View
-
aspectFloatAspect ratio
-
nearFloatNear plane
-
farFloatFar plane
Returns:
Result matrix
perspective
-
fov -
aspect -
near -
far
Sets up a perspective transform, which makes far away objects appear smaller
than nearby objects. The aspect argument is the width divided by the height
of your viewport and fov is the top-to-bottom angle of the field of view in
degrees.
Parameters:
-
fovFloatField of View
-
aspectFloatAspect ratio
-
nearFloatNear plane
-
farFloatFar plane
Returns:
Result matrix
rotate
-
a -
x -
y -
z
Creates a matrix that rotates by a degrees around the vector x, y, z.
Parameters:
-
aFloatAngle in degrees
-
xFloatVector X value
-
yFloatVector Y value
-
zFloatVector Z value
Returns:
Result matrix
rotate
-
xAngle -
yAngle -
zAngle
Creates a matrix that rotates in three axes x, y, z.
Parameters:
-
xAngleFloatin degrees
-
yAngleFloatin degrees
-
zAngleFloatin degrees
Returns:
Result matrix
scale
-
x -
y -
z
Creates a matrix that scales by the vector x, y, z.
Parameters:
-
xFloatVector X value
-
yFloatVector Y value
-
zFloatVector Z value
Returns:
Result matrix
toInverseMat3
()
Matrix3
Returns the matrix that when multiplied with this matrix results in the identity matrix3.
Returns:
Inverted matrix3
transformPoint
()
Vector
Transforms the vector as a point with a w coordinate of 1. This means translations will have an effect, for example.
Returns:
Transformed Vector
transformVector
()
Vector
Transforms the vector as a vector with a w coordinate of 0. This means translations will have no effect, for example.
Returns:
Transformed Vector
Docs for Version: 1.0a