madgui.survey.camera module

Utilities for dealing with coordinate system / camera transformations.

Classes

Camera()

class madgui.survey.camera.Camera[source]

Bases: PyQt5.QtCore.QObject

Attributes

distance

int(x=0) -> integer

far

int(x=0) -> integer

fov

float(x) -> floating point number

near

float(x) -> floating point number

phi

int(x=0) -> integer

psi

int(x=0) -> integer

theta

int(x=0) -> integer

updated(*args, **kwargs)

Call self as a function.

Methods

look_from(theta, phi[, psi])

Set camera position by rotating camera around its view target.

look_toward(theta, phi[, psi])

Rotate camera at fixed position.

projection(width, height)

Return a perspective projection matrix for a viewport with the given size.

translate(dx, dy, dz)

Move camera position and its view center along the local coordinate system.

zoom(scale)

Scale the figure uniformly along both axes.

distance = 1
far = 1000
fov = 70.0
look_from(theta, phi, psi=0)[source]

Set camera position by rotating camera around its view target. The angles are the coordinates of the camera relative to the target, at a distance self.distance.

look_toward(theta, phi, psi=0)[source]

Rotate camera at fixed position. The center of view is recalculated to be at distance self.distance from the camera position in the direction given by the angles.

near = 0.01
phi = 0
projection(width, height)[source]

Return a perspective projection matrix for a viewport with the given size.

psi = 0
theta = 0
translate(dx, dy, dz)[source]

Move camera position and its view center along the local coordinate system. Keeps angles fixed.

updated(*args, **kwargs)

Call self as a function.

zoom(scale)[source]

Scale the figure uniformly along both axes.