pygfx.cameras.Camera

class pygfx.cameras.Camera

Bases: WorldObject

Abstract base camera.

Camera’s are world objects and be placed in the scene, but this is not required.

The purpose of a camera is to define the viewpoint for rendering a scene. This viewpoint consists of its position and orientation (in the world) and its projection.

In other words, it covers the projection of world coordinates to normalized device coordinates (NDC), by the (inverse of) the camera’s own world matrix and the camera’s projection transform. The former represent the camera’s position, the latter is specific to the type of camera.

get_state()

Get the state of the camera as a dict.

set_state(state)

Set the state of the camera from a dict obtained with get_state from a camera of the same type.