Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

A 4x4 Matrix.

 

 

...

Constructor

Matrix4( n11n12n13n14n21n22n23n24n31n32n33n34n41n42n43n44 )

Initialises the matrix with the supplied row-major values n11..n44, or just creates an identity matrix if no values are passed.
Code Block
themeRDark
languagejs
linenumberstrue
// Simple rig for rotating around 3 axes

var m = new THREE.Matrix4();

var m1 = new THREE.Matrix4();
var m2 = new THREE.Matrix4();
var m3 = new THREE.Matrix4();

var alpha = 0;
var beta = Math.PI;
var gamma = Math.PI/2;

m1.makeRotationX( alpha );
m2.makeRotationY( beta );
m3.makeRotationZ( gamma );

m.multiplyMatrices( m1, m2 );
m.multiply( m3 );

Constructor

Matrix4( n11n12n13n14n21n22n23n24n31n32n33n34n41n42n43n44 )

...

Properties

.elements

A column-major list of matrix values.

...