interaction_modes1.py 573 B

12345678910111213141516171819
  1. """Scene interaction styles"""
  2. from vedo import Text2D, Cube, Paraboloid, Plotter, interactor_modes
  3. msg = Text2D(
  4. """TrackballCamera is the default mode\n(press q to proceed)""",
  5. c="k", bg="yellow7", s=1.2,
  6. )
  7. plt = Plotter(shape=(1,2))
  8. plt.at(0).show(Cube(), msg).interactive()
  9. msg.text("..lets change it to JoystickCamera").background("indigo7")
  10. plt.at(1).show(Paraboloid(), mode="JoystickCamera").interactive()
  11. msg.text("..lets change it again to MousePan").background("red6")
  12. mode = interactor_modes.MousePan()
  13. plt.user_mode(mode).interactive()
  14. plt.close()