math docs
    Preparing search index...

    Function perspectiveFromFieldOfViewZO

    • Generates a perspective projection matrix with the given field of view, suitable for WebGPU. This is primarily useful for generating projection matrices to be used with the still experimental WebVR API. The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], which matches WebGPU/Vulkan/DirectX/Metal's clip volume.

      Parameters

      • out: mat4.Mat4

        mat4 frustum matrix will be written into

      • fov: {
            downDegrees: number;
            leftDegrees: number;
            rightDegrees: number;
            upDegrees: number;
        }

        Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees

      • near: number

        Near bound of the frustum

      • far: number

        Far bound of the frustum

      Returns mat4.Mat4

      out