Request

Response

    Autodesk.Viewing.Math
    Version 8 preview
    This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.

    Matrix3

    new Matrix3()

    Represents a 3x3 matrix.

    Properties

    elements
    Float32Array
    A column-major list of matrix values. Precision is set on construction.

    Methods

    set(n11, n12, n13, n21, n22, n23, n31, n32, n33)

    Set the components of this matrix.

    Parameters

    n11*
    number
    Component 1-1.
    n12*
    number
    Component 1-2.
    n13*
    number
    Component 1-3.
    n21*
    number
    Component 2-1.
    n22*
    number
    Component 2-2.
    n23*
    number
    Component 2-3.
    n31*
    number
    Component 3-1.
    n32*
    number
    Component 3-2.
    n33*
    number
    Component 3-3.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    identity()

    Set this matrix to the identity matrix.

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    copy(m)

    Copy the components from another matrix.

    Parameters

    m*The matrix to copy.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    multiplyScalar(s)

    Multiply this matrix by a scalar.

    Parameters

    s*
    number
    The scalar to multiply by.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    determinant()

    Calculate the determinant of this matrix.

    Returns

    typedescription
    number The determinant.

    getInverse(matrix, throwOnInvertible)

    Set this matrix to the inverse of a 4x4 matrix.

    Parameters

    matrix*The 4x4 matrix to invert.
    throwOnInvertible
    boolean
    Whether to throw an error if not invertible.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    invert()

    Inverts this matrix.

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    makeRotationFromQuaternion(q)

    Set this matrix to a rotation matrix from a quaternion.

    Parameters

    q*The quaternion to set the rotation from.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    transpose()

    Transpose this matrix.

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    getNormalMatrix(m)

    Set this matrix to the normal matrix (inverse transpose) of a Matrix4.

    Parameters

    m*The Matrix4 to convert.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    fromArray(array)

    Set this matrix from an 9-element array.

    Parameters

    array*
    Array.<number>
    The source array.
    * Required

    Returns

    typedescription
    Matrix3 A reference to this matrix.

    toArray()

    Convert this matrix to an array.

    Returns

    typedescription
    Array.<number> The array containing the matrix elements.

    clone()

    Create a clone of this matrix.

    Returns

    typedescription
    Matrix3 A new matrix with the same components.