TurntableCamera¶
-
class
TurntableCamera
(fov=0.0, elevation=30.0, azimuth=30.0, roll=0.0, distance=None, **kwargs)[source]¶ Bases:
vispy.scene.cameras.perspective.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 thecenter
indicates the position to put at the center of the view.- Parameters
fov (float) – Field of view. Zero (default) means orthographic projection.
elevation (float) – Elevation angle in degrees. Positive angles place the camera above the cente point, negative angles place the camera below the center point.
azimuth (float) – Azimuth angle in degrees. Zero degrees places the camera on the positive x-axis, pointing in the negative x direction.
roll (float) – Roll angle in degrees
distance (float | 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.
**kwargs (dict) – 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
-
orbit
(azim, elev)[source]¶ Orbits the camera around the center position.
- Parameters
azim (float) – Angle in degrees to rotate horizontally around the center point.
elev (float) – Angle in degrees to rotate vertically around the center point.
-
viewbox_mouse_event
(event)[source]¶ The viewbox received a mouse event; update transform accordingly.
- Parameters
event (instance of Event) – The event.
-
property
azimuth
¶ The angle of the camera in degrees around the y axis. An angle of 0 places the camera within the (y, z) plane.
-
property
elevation
¶ The angle of the camera in degrees above the horizontal (x, z) plane.
-
property
roll
¶ The angle of the camera in degrees around the z axis. An angle of 0 places puts the camera upright.