Serializable THREE.js Matrix4

Hierarchy (view full)

Constructors

  • Creates an identity matrix.

    Returns Matrix4

  • Creates a 4x4 matrix with the given arguments in row-major order.

    Parameters

    • n11: number
    • n12: number
    • n13: number
    • n14: number
    • n21: number
    • n22: number
    • n23: number
    • n24: number
    • n31: number
    • n32: number
    • n33: number
    • n34: number
    • n41: number
    • n42: number
    • n43: number
    • n44: number

    Returns Matrix4

Properties

elements: number[]

Methods

  • Sets this matrix to the transformation composed of translation, rotation and scale.

    Parameters

    • translation: Vector3
    • rotation: Quaternion
    • scale: Vector3

    Returns this

  • Parameters

    • m: Matrix4

    Returns this

  • Parameters

    • m: Matrix4

    Returns this

  • Parameters

    • v: any

    Returns void

    Deprecated

    Use vector.applyMatrix4( matrix ) instead.

  • Decomposes this matrix into it's position, quaternion and scale components.

    Parameters

    • translation: Vector3
    • rotation: Quaternion
    • scale: Vector3

    Returns this

  • Parameters

    • matrix: Matrix4

    Returns boolean

  • Parameters

    • xAxis: Vector3
    • yAxis: Vector3
    • zAxis: Vector3

    Returns this

  • Parameters

    • m: Matrix4

    Returns Matrix4

    Deprecated

    Use .copyPosition() instead.

  • Copies the rotation component of the supplied matrix m into this matrix rotation component.

    Parameters

    • m: Matrix4

    Returns this

  • Parameters

    • array: number[]
    • offset: number

    Returns number[]

    Deprecated

    Use .toArray() instead.

  • Sets the values of this matrix from the provided array or array-like.

    Parameters

    • array: number[] | ArrayLike<number>

      the source array or array-like.

    • Optional offset: number

      (optional) offset into the array-like. Default is 0.

    Returns this

  • Parameters

    • matrix: Matrix

    Returns Matrix

    Deprecated

    Use .invert() instead.

  • Returns number

  • Resets this matrix to identity.

    Returns this

  • Inverts this matrix.

    Returns this

  • Constructs a rotation matrix, looking from eye towards center with defined up vector.

    Parameters

    • eye: Vector3
    • target: Vector3
    • up: Vector3

    Returns this

  • Parameters

    • xAxis: Vector3
    • yAxis: Vector3
    • zAxis: Vector3

    Returns this

  • Creates an orthographic projection matrix.

    Parameters

    • left: number
    • right: number
    • top: number
    • bottom: number
    • near: number
    • far: number
    • Optional coordinateSystem: CoordinateSystem

    Returns this

  • Creates a perspective projection matrix.

    Parameters

    • left: number
    • right: number
    • top: number
    • bottom: number
    • near: number
    • far: number
    • Optional coordinateSystem: CoordinateSystem

    Returns this

  • Sets this matrix as rotation transform around axis by angle radians. Based on http://www.gamedev.net/reference/articles/article1199.asp.

    Parameters

    • axis: Vector3

      Rotation axis.

    • angle: number

    Returns this

  • Parameters

    • euler: Euler

    Returns this

  • Parameters

    • q: Quaternion

    Returns this

  • Sets this matrix as rotation transform around x axis by theta radians.

    Parameters

    • theta: number

      Rotation angle in radians.

    Returns this

  • Sets this matrix as rotation transform around y axis by theta radians.

    Parameters

    • theta: number

      Rotation angle in radians.

    Returns this

  • Sets this matrix as rotation transform around z axis by theta radians.

    Parameters

    • theta: number

      Rotation angle in radians.

    Returns this

  • Sets this matrix as scale transform.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns this

  • Sets this matrix as shear transform.

    Parameters

    • xy: number
    • xz: number
    • yx: number
    • yz: number
    • zx: number
    • zy: number

    Returns this

  • Sets this matrix as translation transform.

    Parameters

    • v: Vector3

    Returns this

  • Parameters

    • x: number
    • y: number
    • z: number

    Returns this

  • Multiplies this matrix by m.

    Parameters

    • m: Matrix4

    Returns this

  • Sets this matrix to a x b.

    Parameters

    • a: Matrix4
    • b: Matrix4

    Returns this

  • Multiplies this matrix by s.

    Parameters

    • s: number

    Returns this

  • 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.

    Parameters

    • a: Matrix4
    • b: Matrix4
    • r: number[]

    Returns Matrix4

    Deprecated

    This method has been removed completely.

  • Parameters

    • v: any

    Returns any

    Deprecated

    Use vector.applyMatrix4( matrix ) instead.

  • Parameters

    • array: number[]

    Returns number[]

    Deprecated

    This method has been removed completely.

  • Parameters

    • v: any

    Returns any

    Deprecated

    Use vector.applyMatrix4( matrix ) instead.

  • Parameters

    • m: Matrix4

    Returns this

  • Parameters

    • v: any

    Returns void

    Deprecated

    Use Vector3.transformDirection( matrix ) instead.

  • Multiplies the columns of this matrix by vector v.

    Parameters

    • v: Vector3

    Returns this

  • Sets all fields of this matrix.

    Parameters

    • n11: number
    • n12: number
    • n13: number
    • n14: number
    • n21: number
    • n22: number
    • n23: number
    • n24: number
    • n31: number
    • n32: number
    • n33: number
    • n34: number
    • n41: number
    • n42: number
    • n43: number
    • n44: number

    Returns this

  • Set the upper 3x3 elements of this matrix to the values of the Matrix3 m.

    Parameters

    • m: Matrix3

    Returns this

  • Sets the position component for this matrix from vector v.

    Parameters

    • v: Vector3

    Returns this

  • Parameters

    • x: number
    • y: number
    • z: number

    Returns this

  • Parameters

    • q: Quaternion

    Returns Matrix4

    Deprecated

    Use .makeRotationFromQuaternion() instead.

  • Returns an array with the values of this matrix, or copies them into the provided array.

    Parameters

    • Optional array: number[]

      (optional) array to store the matrix to. If this is not provided, a new array will be created.

    • Optional offset: number

      (optional) optional offset into the array.

    Returns number[]

    The created or provided array.

  • Parameters

    • Optional array: Matrix4Tuple
    • Optional offset: 0

    Returns Matrix4Tuple

  • Copies he values of this matrix into the provided array-like.

    Parameters

    • Optional array: ArrayLike<number>

      array-like to store the matrix to.

    • Optional offset: number

      (optional) optional offset into the array-like.

    Returns ArrayLike<number>

    The provided array-like.

  • Transposes this matrix.

    Returns this

  • Create a rotation matrix from euler angles

    Type Parameters

    Parameters

    • vector: Vector3

      Vector

    • angle: number

      Angle

    Returns T

    Rotation matrix

  • Create a rotation matrix from euler angles

    Type Parameters

    Parameters

    • euler: Euler

      Euler angles

    Returns T

    Rotation matrix

  • Create a rotation matrix from quaternion

    Type Parameters

    Parameters

    • quat: Quaternion

      Quaternion

    Returns T

    Rotation matrix