Function frustumMat4v

  • Returns a 4x4 perspective frustum projection matrix, defined by the given near and far planes and the frustum bounds.

    This function generates a perspective frustum matrix, which is useful for 3D transformations that map coordinates within a frustum defined by the near and far planes, and the left, right, bottom, and top frustum bounds.

    Parameters

    • fmin: FloatArrayParam

      The minimum bounds of the frustum, represented as [left, bottom, near].

    • fmax: FloatArrayParam

      The maximum bounds of the frustum, represented as [right, top, far].

    • Optionalm: FloatArrayParam

      An optional destination matrix to store the result. If not provided, a new matrix is created.

    Returns FloatArrayParam

    The resulting 4x4 frustum projection matrix. If m is provided, it will be modified; otherwise, a new matrix is returned.

    const fmin = [-1, -1, 0.1];
    const fmax = [1, 1, 100];
    const matrix = frustumMat4v(fmin, fmax);
    console.log(matrix);