picogl.backend.legacy.core.camera.look_at
look_at.py
This module provides a utility function for constructing a view matrix, commonly used in 3D graphics to simulate a camera’s perspective.
The look_at function generates a 4×4 transformation matrix that positions and orients a virtual camera in world space. It takes the camera’s position, a target point to look at, and an up direction vector to define the camera’s orientation.
Typical use cases include: - Setting up camera views in OpenGL or other rendering engines - Transforming world coordinates into view (camera) space - Creating custom camera systems for simulations or games
- Function:
- look_at(eye, target, up) -> np.ndarray
Constructs a view matrix from camera position, target, and up vector.
Functions
|
look_at |
Module Contents
- picogl.backend.legacy.core.camera.look_at.look_at(eye: numpy.ndarray, target: numpy.ndarray, up: numpy.ndarray) numpy.ndarray[source]
look_at
- Parameters:
eye – np.array 3D position of the camera (shape: (3,))
target – np.array 3D position the camera is looking at (shape: (3,))
up – np.array Up direction vector (shape: (3,))
- Returns:
np.array 4x4 v
Constructs a view matrix simulating a camera looking from ‘eye’ to ‘target’.