picogl.core.viewport

Represents a rectangular viewport with position and dimensions.

The class provides positional information, size, aspect ratio, and a method to retrieve the viewport as a numerical array.

Classes

Viewport

Represents a rectangular viewport with position and dimensions.

GLViewport

Represents a rectangular viewport with position and dimensions.

Module Contents

class picogl.core.viewport.Viewport[source]

Represents a rectangular viewport with position and dimensions.

x: int[source]
y: int[source]
width: int[source]
height: int[source]
property size: tuple[int, int][source]
property aspect_ratio: float[source]
as_array() → numpy.ndarray[source]
as_tuple() → tuple[int, int, int, int][source]
unproject(x: float, y: float, depth: float, inv_mvp: pyglm.glm.mat4) → numpy.ndarray | None[source]

unproject

flip_y(y: float) → float[source]
static world(inv_mvp: pyglm.glm.mat4, ndc: numpy.ndarray) → numpy.ndarray[source]
ndc(depth: float, x: float, y: float) → numpy.ndarray[Any, numpy.dtype[Any]] | numpy.ndarray[Any, numpy.dtype[numpy.generic]][source]
_unproject_for_depth(x: float, y: float, inv_mvp, depth: float) → numpy.ndarray | None[source]
near(x: float, y: float, inv_mvp: pyglm.glm.mat4) → numpy.ndarray | None[source]
far(x: float, y: float, inv_mvp: pyglm.glm.mat4) → numpy.ndarray | None[source]
property center: tuple[float, float][source]
contains(x: float, y: float) → bool[source]
property rect: tuple[int, int, int, int][source]
class picogl.core.viewport.GLViewport(*args, **kwargs)[source]

Bases: Viewport

Represents a rectangular viewport with position and dimensions.

apply()[source]
update(x: int, y: int, w: int, h: int)[source]