Skip to content

Threepp.Matrix4

4x4 matrix class

Represents a transformation matrix.

Members

Constructors

Methods


Matrix4

Constructor

Description

Constructor

Creates an identity matrix.


set

Method

Arguments

Arguments Default Description
n11  
n12  
n13  
n14  
n21  
n22  
n23  
n24  
n31  
n32  
n33  
n34  
n41  
n42  
n43  
n44  

Description

Sets the elements


identity

Method

Description

Resets to the identity matrix


copy

Method

Arguments

Arguments Default Description
m  

Description

Copies another matrix


copyPosition

Method

Arguments

Arguments Default Description
m  

Description

Copies only the translation component


extractBasis

Method

Arguments

Arguments Default Description
xAxis  
yAxis  
zAxis  

Description

Extracts the basis vectors


makeBasis

Method

Arguments

Arguments Default Description
xAxis  
yAxis  
zAxis  

Description

Creates a matrix from basis vectors


extractRotation

Method

Arguments

Arguments Default Description
m  

Description

Extracts the rotation component


makeRotationFromEuler

Method

Arguments

Arguments Default Description
euler  

Description

Creates a rotation matrix from Euler angles


makeRotationFromQuaternion

Method

Arguments

Arguments Default Description
q  

Description

Creates a rotation matrix from a quaternion


lookAt

Method

Arguments

Arguments Default Description
eye  
target  
up  

Description

Creates a look-at matrix


multiply

Method

Arguments

Arguments Default Description
m  

Description

Multiplies by a matrix


premultiply

Method

Arguments

Arguments Default Description
m  

Description

Premultiplies by a matrix


multiplyMatrices

Method

Arguments

Arguments Default Description
a  
b  

Description

Product of two matrices


multiplyScalar

Method

Arguments

Arguments Default Description
s  

Description

Multiplies by a scalar


determinant

Method

Description

Determinant


transpose

Method

Description

Transposes the matrix


setPosition

Method

Arguments

Arguments Default Description
v  

Description

Sets the position


invert

Method

Description

Inverts the matrix


scale

Method

Arguments

Arguments Default Description
v  

Description

Scales the matrix


getMaxScaleOnAxis

Method

Description

Maximum scale along any axis


makeTranslation

Method

Arguments

Arguments Default Description
v  

Description

Creates a translation matrix


makeRotationX

Method

Arguments

Arguments Default Description
theta  

Description

Creates a rotation matrix around the X axis


makeRotationY

Method

Arguments

Arguments Default Description
theta  

Description

Creates a rotation matrix around the Y axis


makeRotationZ

Method

Arguments

Arguments Default Description
theta  

Description

Creates a rotation matrix around the Z axis


makeRotationAxis

Method

Arguments

Arguments Default Description
axis  
angle  

Description

Creates a rotation matrix around an arbitrary axis


makeScale

Method

Arguments

Arguments Default Description
x  
y  
z  

Description

Creates a scale matrix


makeShear

Method

Arguments

Arguments Default Description
xy  
xz  
yx  
yz  
zx  
zy  

Description

Creates a shear matrix


compose

Method

Arguments

Arguments Default Description
position  
quaternion  
scale  

Description

Composes the matrix from position, rotation and scale


decompose

Method

Arguments

Arguments Default Description
position  
quaternion  
scale  

Description

Decomposes the matrix into position, rotation and scale


makePerspective

Method

Arguments

Arguments Default Description
left  
right  
top  
bottom  
near  
far  

Description

Creates a perspective projection matrix


makeOrthographic

Method

Arguments

Arguments Default Description
left  
right  
top  
bottom  
near  
far  

Description

Creates an orthographic projection matrix


equals

Method

Arguments

Arguments Default Description
m  

Description

Equality test