picogl.backend.modern.core.unproject

Modern OpenGL Unproject Function

Functions

unproject(x, y, depth, inv_mvp, viewport)

unproject_test3(x, y, depth, inv_mvp, viewport)

unproject_test(x, y, depth, inv_mvp, viewport[, ...])

unproject_new(x, y, depth, model_view, projection, ...)

unproject_old(→ tuple[Any, Ellipsis] | None)

unproject

Module Contents

picogl.backend.modern.core.unproject.unproject(x, y, depth, inv_mvp, viewport)[source]
picogl.backend.modern.core.unproject.unproject_test3(x, y, depth, inv_mvp, viewport)[source]
picogl.backend.modern.core.unproject.unproject_test(x, y, depth, inv_mvp, viewport, already_inverted=False)[source]
picogl.backend.modern.core.unproject.unproject_new(x, y, depth, model_view, projection, viewport)[source]
picogl.backend.modern.core.unproject.unproject_old(x: int, y: int, depth: float, model_view: numpy.ndarray, projection: numpy.ndarray, viewport: Tuple[int, int, int, int]) tuple[Any, Ellipsis] | None[source]

unproject

Parameters:
  • x – X screen coordinate

  • y – Y screen coordinate

  • depth – Depth value from depth buffer (range 0.0 - 1.0)

  • model_view – 4x4 model_matrix-view matrix

  • projection – 4x4 projection matrix

  • viewport – Viewport tuple (x, y, width, height)

Returns:

(x, y, z) in world space, or None if invalid

Unprojects 2D screen coordinates into 3D world coordinates in modern OpenGL.