picogl.backend.legacy.core.camera.perspective

This module provides functions for constructing projection matrices used in 3D graphics, such as perspective projection matrices compatible with OpenGL and other rendering pipelines.

Functions:
  • perspective: Constructs a 4x4 perspective projection matrix.

Functions

perspective(→ numpy.ndarray)

Create a perspective projection matrix.

Module Contents

picogl.backend.legacy.core.camera.perspective.perspective(fovy: float, aspect: float, znear: float, zfar: float) numpy.ndarray[source]

Create a perspective projection matrix.

Parameters:
  • fovy (float) – Field of view angle in the y-direction, in degrees.

  • aspect (float) – Aspect ratio of the viewport (width / height).

  • znear (float) – Distance to the near clipping plane (must be > 0).

  • zfar (float) – Distance to the far clipping plane (must be > znear).

Returns:

A 4x4 perspective projection matrix.

Return type:

numpy.ndarray