# Examples from pyvista.Plotter.fly_to
# ====================================

# Animate the camera's focal point from the sphere to the cube.
import pyvista as pv
pl = pv.Plotter()
_ = pl.add_mesh(pv.Sphere(center=(-1, 0, 0)))
_ = pl.add_mesh(pv.Cube(center=(1, 0, 0)))
text_actor = pl.add_text("Pressing 'q' will center on the cube")
pl.show(auto_close=False)
pl.fly_to((1, 0, 0))
pl.remove_actor(text_actor)
pl.show(auto_close=True)

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

