new Matrix4(m)math3d.js:303Create a matrix, identity by default
mFloat32Array|Array<number> optional16 column major values
const m = buildMatrix(vec3(0, 1, 0), vec3(0, PI/2, 0)); // rotate then move up
const p = m.transformPoint(vec3(1, 0, 0));4x4 transform matrix for moving, rotating and scaling points in 3D
new Matrix4(m)math3d.js:303Create a matrix, identity by default
m Float32Array|Array<number> optional16 column major values
const m = buildMatrix(vec3(0, 1, 0), vec3(0, PI/2, 0)); // rotate then move up
const p = m.transformPoint(vec3(1, 0, 0));m : Float32Arraymath3d.js:310The 16 column major values
copy() → Matrix4math3d.js:422Returns a new matrix that is a copy of this
determinant() → numbermath3d.js:531Returns the determinant of the rotation and scale part: negative when the matrix mirrors, 0 when it flattens a shape and has no inverse
getRotation() → Vector3math3d.js:550Returns the rotation part of this matrix as vec3(pitch, yaw, roll), the angles Matrix4.rotation builds it from
getScale() → Vector3math3d.js:539Returns the scale part of this matrix, the length of each axis; a mirroring matrix shows as a negative x
getTranslation() → Vector3math3d.js:526Returns the translation part of this matrix
Returns a new identity matrix
invert() → Matrix4math3d.js:469Flip this matrix so it undoes itself, returns this and does nothing if it cannot be inverted
Returns the transform of something at eye turned to face target
multiply(matrix) → Matrix4math3d.js:427Multiply this matrix by another and return this, the other happens first
matrix Matrix4Returns a new orthographic projection, camera looks down -Z
left numberEdge of the visible box
right numberEdge of the visible box
bottom numberEdge of the visible box
top numberEdge of the visible box
near numberClosest visible distance
far numberFurthest visible distance, Infinity is not allowed here
Returns a new perspective projection, camera looks down -Z
fov numberVertical field of view in radians
aspect numberWidth divided by height
near numberClosest visible distance
far numberFurthest visible distance, Infinity is allowed
rotate(euler) → Matrix4math3d.js:445Append a rotation, returns self
euler Vector3vec3(pitch, yaw, roll) in radians
Returns a rotation matrix, rolled first, then pitched, then yawed
toString() → stringmath3d.js:567Returns a string representation of this matrix for debugging
transpose() → Matrix4math3d.js:454Transpose this matrix in place, returns self