picogl.core.camera

Shared camera defaults used by Qt, GLUT, and backend projection helpers.

Attributes

FOVY

DEFAULT_CAMERA_CONFIG

Classes

ProjectionConfig

Perspective projection parameters used by PicoGL camera helpers.

CameraParameters

Look-at parameters that build a view matrix.

CameraConfig

Bundled camera pose plus projection settings.

Module Contents

class picogl.core.camera.ProjectionConfig[source]

Perspective projection parameters used by PicoGL camera helpers.

fovy: float = 45.0[source]
aspect: float = 1.0[source]
near: float = 5.0[source]
far: float = 1000.0[source]
with_aspect(aspect: float) → ProjectionConfig[source]

Return a copy with aspect set.

with_size(width: float, height: float) → ProjectionConfig[source]

Return a copy with aspect from width / max(height, 1).

matrix(aspect: float | None = None) → pyglm.glm.mat4[source]

Build a perspective projection matrix.

If aspect is given, use it without mutating this config.

picogl.core.camera.FOVY = 45.0[source]
class picogl.core.camera.CameraParameters[source]

Look-at parameters that build a view matrix.

Example:

camera = CameraParameters(eye=glm.vec3(4, 3, zoom_distance))
view = camera.view_matrix()
eye: pyglm.glm.vec3[source]
center: pyglm.glm.vec3[source]
up: pyglm.glm.vec3[source]
view_matrix() → pyglm.glm.mat4[source]

Build the view matrix for this look-at triple.

classmethod tutorial(distance: float = 3.0, *, z_sign: float = 1.0) → CameraParameters[source]

OpenGL-tutorial style eye at (4, 3, z_sign * distance).

class picogl.core.camera.CameraConfig[source]

Bundled camera pose plus projection settings.

position: pyglm.glm.vec3[source]
target: pyglm.glm.vec3[source]
up: pyglm.glm.vec3[source]
projection: ProjectionConfig[source]
camera_parameters() → CameraParameters[source]

Look-at triple for this camera (ignores projection).

picogl.core.camera.DEFAULT_CAMERA_CONFIG[source]