Function create

  • Create a Mat3 from values

    Note: Since passing in a raw JavaScript array is valid in all circumstances, if you want to force a JavaScript array into a Mat3's specified type it would be faster to use

    const m = mat3.clone(someJSArray);
    

    Note: a consequence of the implementation is if your Mat3Type = Array instead of Float32Array or Float64Array then any values you don't pass in will be undefined. Usually this is not an issue since (a) using Array is rare and (b) using mat3.create is usually used to create a Mat3 to be filled out as in

    const m = mat3.create();
    mat3.perspective(fov, aspect, near, far, m);

    Parameters

    • Optional v0: number

      value for element 0

    • Optional v1: number

      value for element 1

    • Optional v2: number

      value for element 2

    • Optional v3: number

      value for element 3

    • Optional v4: number

      value for element 4

    • Optional v5: number

      value for element 5

    • Optional v6: number

      value for element 6

    • Optional v7: number

      value for element 7

    • Optional v8: number

      value for element 8

    Returns Mat3

    matrix created from values.