File: interaction_modes3.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 852 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Interaction mode to fly over a surface.
- Press arrows to move the camera in the plane of the surface.
- "t" and "g" will move the camera up and down along z.
- "x" and "X" will reset the camera to the default position towards +/-x.
- "y" and "Y" will reset the camera to the default position towards +/-y.
- "." and "," will rotate azimuth to the right or left.
- "r" will reset the camera to the default position."""
from vedo import *
from vedo.interactor_modes import FlyOverSurface

settings.enable_default_keyboard_callbacks = False
settings.enable_default_mouse_callbacks = False

surf = ParametricShape("RandomHills").cmap("Spectral")

mode = FlyOverSurface()
txt = Text2D(__doc__, c="k", font="Antares", s=0.8)

plt = Plotter(size=(1200, 600))
plt.user_mode(mode)
plt.show(surf, Axes(surf), txt, elevation=-90, zoom=2, axes=14)
plt.close()