Function perspective

perspective(fovy, aspect, [zNear], [zFar]) returns a $4 \times 4$ perspective projection matrix.

  • Parameters

    • fovy: Num

      field of view angle, in degrees, in the y direction

    • aspect: Num

      aspect ratio that determines the field of view in the x direction

    • zNear: Num = 0.1

      distance from the viewer to the near clipping plane (always positive)

    • zFar: Num = 100.0

      distance from the viewer to the far clipping plane (always positive)

    Returns Num[][]

    Perspective projection matrix