picogl.backend.glu.lookat

Provides functionality for representing spatial coordinates and a camera view in 3D space.

This module defines utility functions and protocols for transforming spatial data into (x, y, z) tuples, as well as for setting up a camera view using OpenGL’s gluLookAt function. It includes support for Coordinates objects, 3-element sequences, and other objects with x, y, and z attributes.

Classes

SupportsXYZ

Supports XYZ

Functions

_to_xyz(v) → tuple[float, float, float]

Return v as an (x, y, z) tuple.

glu_look_at(eye_x, eye_y, eye_z, center_x, center_y, ...) → None

glu lookat

glu_look_at_coords(eye, center, up) → None

Preferred API: pass three Coordinates (or 3-element sequences / objects with x,y,z).

Module Contents

class picogl.backend.glu.lookat.SupportsXYZ[source]

Bases: Protocol

Supports XYZ

x: float[source]
y: float[source]
z: float[source]
picogl.backend.glu.lookat._to_xyz(v: molib.pdb.coordinate.coordinate.Coordinate3D | collections.abc.Sequence[float] | Any) → tuple[float, float, float][source]

Return v as an (x, y, z) tuple.

picogl.backend.glu.lookat.glu_look_at(eye_x: float, eye_y: float, eye_z: float, center_x: float, center_y: float, center_z: float, up_x: float, up_y: float, up_z: float) → None[source]

glu lookat

picogl.backend.glu.lookat.glu_look_at_coords(eye: molib.pdb.coordinate.coordinate.Coordinate3D | collections.abc.Sequence[float] | Any, center: molib.pdb.coordinate.coordinate.Coordinate3D | collections.abc.Sequence[float] | Any, up: molib.pdb.coordinate.coordinate.Coordinate3D | collections.abc.Sequence[float] | Any) → None[source]

Preferred API: pass three Coordinates (or 3-element sequences / objects with x,y,z).