interaction_modes3.py 899 B

12345678910111213141516171819202122
  1. """Interaction mode to fly over a surface.
  2. - Press arrows to move the camera in the plane of the surface.
  3. - "t" and "g" will move the camera up and down along z.
  4. - "x" and "X" will reset the camera to the default position towards +/-x.
  5. - "y" and "Y" will reset the camera to the default position towards +/-y.
  6. - "." and "," will rotate azimuth to the right or left.
  7. - "r" will reset the camera to the default position."""
  8. from vedo import settings, ParametricShape, Text2D, Axes, Plotter
  9. from vedo.interactor_modes import FlyOverSurface
  10. settings.enable_default_keyboard_callbacks = False
  11. settings.enable_default_mouse_callbacks = False
  12. surf = ParametricShape("RandomHills").cmap("Spectral")
  13. mode = FlyOverSurface()
  14. txt = Text2D(__doc__, c="k", font="Antares", s=0.8)
  15. plt = Plotter(size=(1200, 600))
  16. plt.user_mode(mode)
  17. plt.show(surf, Axes(surf), txt, elevation=-90, zoom=2, axes=14)
  18. plt.close()