import { Matrix4 } from "https://deno.land/x/threejs_4_deno@v121/src/math/Matrix4.d.ts";
A 4x4 Matrix.
Examples
// Simple rig for rotating around 3 axes
const m = new THREE.Matrix4();
const m1 = new THREE.Matrix4();
const m2 = new THREE.Matrix4();
const m3 = new THREE.Matrix4();
const alpha = 0;
const beta = Math.PI;
const gamma = Math.PI/2;
m1.makeRotationX( alpha );
m2.makeRotationY( beta );
m3.makeRotationZ( gamma );
m.multiplyMatrices( m1, m2 );
m.multiply( m3 );
// Simple rig for rotating around 3 axes const m = new THREE.Matrix4(); const m1 = new THREE.Matrix4(); const m2 = new THREE.Matrix4(); const m3 = new THREE.Matrix4(); const alpha = 0; const beta = Math.PI; const gamma = Math.PI/2; m1.makeRotationX( alpha ); m2.makeRotationY( beta ); m3.makeRotationZ( gamma ); m.multiplyMatrices( m1, m2 ); m.multiply( m3 );
Methods
Sets this matrix to the transformation composed of translation, rotation and scale.
Computes determinant of this matrix. Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
Sets this matrix to the inverse of matrix m. Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm.
Creates an orthographic projection matrix.
Creates a frustum matrix.
Creates a perspective projection matrix.
Sets this matrix as rotation transform around axis by angle radians. Based on http://www.gamedev.net/reference/articles/article1199.asp.
Sets this matrix as rotation transform around x axis by theta radians.
Sets this matrix as rotation transform around y axis by theta radians.
Sets this matrix as rotation transform around z axis by theta radians.
Sets this matrix to a x b and stores the result into the flat array r. r can be either a regular Array or a TypedArray.
Sets all fields of this matrix.
Returns an array with the values of this matrix, or copies them into the provided array.
Copies he values of this matrix into the provided array-like.