pygfx.controllers.TrackballController

class pygfx.controllers.TrackballController(camera=None, *, enabled=True, damping=4, auto_update=True, register_events=None)

Bases: OrbitController

A controller to freely rotate a camera around a center position.

This controller is similar to the OrbitController, but it does not maintain a constant camera up vector.

Default controls:

  • Left mouse button: orbit / rotate.

  • Right mouse button: pan.

  • Fourth mouse button: quickzoom

  • wheel: zoom to point.

  • alt+wheel: adjust fov.

rotate(delta: Tuple, rect: Tuple, *, animate=False)

Rotate around the target, using two angles (in radians).

If animate is True, the motion is damped. This requires the controller to receive events from the renderer/viewport.