vispy.scene.cameras.fly module#

class vispy.scene.cameras.fly.FlyCamera(fov=60, rotation=None, **kwargs)#

Bases: PerspectiveCamera

The fly camera provides a way to explore 3D data using an interaction style that resembles a flight simulator.

For this camera, the scale_factor indicates the speed of the camera in units per second, and the center indicates the position of the camera.

Parameters:
fovfloat

Field of view. Default 60.0.

rotationfloat | None

Rotation to use.

**kwargsdict

Keyword arguments to pass to BaseCamera.

Notes

Interacting with this camera might need a bit of practice. The reaction to key presses can be customized by modifying the keymap property.

Moving:

  • arrow keys, or WASD to move forward, backward, left and right

  • F and C keys move up and down

  • Space bar to brake

Viewing:

  • Use the mouse while holding down LMB to control the pitch and yaw.

  • Alternatively, the pitch and yaw can be changed using the keys IKJL

  • The camera auto-rotates to make the bottom point down, manual rolling can be performed using Q and E.

property auto_roll#

Whether to rotate the camera automaticall to try and attempt to keep Z up.

property keymap#

A dictionary that maps keys to thruster directions

The keys in this dictionary are vispy key descriptions (from vispy.keys) or characters that represent keys. These are matched to the “key” attribute of key-press and key-release events.

The values are tuples, in which the first element specifies the magnitude of the acceleration, using negative values for “backward” thrust. A value of zero means to brake. The remaining elements specify the dimension to which the acceleration should be applied. These are 1, 2, 3 for forward/backward, left/right, up/down, and 4, 5, 6 for pitch, yaw, roll.

on_timer(event)#

Timer event handler

Parameters:
eventinstance of Event

The event.

property rotation#

Get the full rotation. This rotation is composed of the normal rotation plus the extra rotation due to the current interaction of the user.

property rotation1#

rotation1 records confirmed camera rotation

property rotation2#

rotation2 records on going camera rotation.

viewbox_key_event(event)#

The ViewBox key event handler

Parameters:
eventinstance of Event

The event.

viewbox_mouse_event(event)#

The ViewBox mouse event handler

Parameters:
eventinstance of Event

The event.