Plotter.fly_to

Contents

Plotter.fly_to#

Plotter.fly_to(point: Sequence[float]) None[source]#

Move the current camera’s focal point to a position point.

The movement is animated over the number of frames specified in NumberOfFlyFrames. The LOD desired frame rate is used.

Parameters:
pointsequence[float]

Point to fly to in the form of (x, y, z).

Examples#

Download Python source code | Download Jupyter notebook

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)