-
Notifications
You must be signed in to change notification settings - Fork 103
mat4
cjcliffe edited this page Oct 15, 2011
·
3 revisions
The mat4
object provides tools for working with 4x4 Matrices.
Multiply one 4x4 Matrix by another.
Parameters:
-
m1
: First Matrix. -
m2
: Second Matrix.
Returns:
Array of 16 floats representing 4x4 result.
Transform a 1x4 vector by a 4x4 Matrix.
Parameters:
-
v1
: 1x4 Vector -
m2
: Second Matrix
Returns:
Transformed 1x4 vector, format: [0.0, 0.0, 0.0, 0.0]
Transform a 1x3 vector by a 4x4 Matrix.
Parameters:
-
v1
: 1x3 Vector -
m2
: Second Matrix
Returns:
Transformed 1x3 vector, format: [0.0, 0.0, 0.0]
Produce a 4x4 perspective projection matrix.
Parameters:
-
fovy
: Field of View in Degrees -
aspect
: Aspect Ratio -
near
: Near Plane -
far
: Far Plane
Returns:
Array of 16 floats representing 4x4 perspective matrix.
Emulates gluLookAt()
for directly manipulating the camera frustum.
Parameters:
-
eyeX
: Eye X coordinate position -
eyeY
: Eye Y coordinate position -
eyeZ
: Eye Z coordinate position -
lookAtX
: Target X coordinate position -
lookAtY
: Target Y coordinate position -
lookAtZ
: Target Z coordinate position -
upX
: Camera up-axis vector, X component -
upY
: Camera up-axis vector, Y component -
upZ
: Camera up-axis vector, Z component
Returns:
Array of 16 floats representing 4x4 "lookAt" transform.