vispy.scene.cameras.turntable module#

class vispy.scene.cameras.turntable.TurntableCamera(fov=45.0, elevation=30.0, azimuth=30.0, roll=0.0, distance=None, translate_speed=1.0, **kwargs)#

Bases: Base3DRotationCamera

3D camera class that orbits around a center point while maintaining a view on a center point.

For this camera, the scale_factor indicates the zoom level, and the center indicates the position to put at the center of the view.

When elevation and azimuth are set to 0, the camera points along the +y axis.

Parameters:
fovfloat

Field of view. 0.0 means orthographic projection, default is 45.0 (some perspective)

elevationfloat

Elevation angle in degrees. The elevation angle represents a rotation of the camera around the current scene x-axis. The camera points along the x-y plane when the angle is 0.

azimuthfloat

Azimuth angle in degrees. The azimuth angle represents a rotation of the camera around the scene z-axis according to the right-hand screw rule. The camera points along the y-z plane when the angle is 0.

rollfloat

Roll angle in degrees. The roll angle represents a rotation of the camera around the current scene y-axis.

distancefloat | None

The distance of the camera from the rotation point (only makes sense if fov > 0). If None (default) the distance is determined from the scale_factor and fov.

translate_speedfloat

Scale factor on translation speed when moving the camera center point.

**kwargsdict

Keyword arguments to pass to BaseCamera.

Notes

Interaction:

  • LMB: orbits the view around its center point.

  • RMB or scroll: change scale_factor (i.e. zoom level)

  • SHIFT + LMB: translate the center point

  • SHIFT + RMB: change FOV

property azimuth#

Get the camera azimuth angle in degrees.

The camera points along the y-z plane when the angle is 0.

property elevation#

Get the camera elevation angle in degrees.

The camera points along the x-y plane when the angle is 0.

orbit(azim, elev)#

Orbits the camera around the center position.

Parameters:
azimfloat

Angle in degrees to rotate horizontally around the center point.

elevfloat

Angle in degrees to rotate vertically around the center point.

property roll#

Get the camera roll angle in degrees.