Note
Go to the end to download the full example code
Orbiting#
Orbit around a scene.
Note
The quality of the movie will be better when using
p.open_movie('orbit.mp4')
instead of
p.open_gif('orbit.gif')
For orbiting to work you first have to show the scene and leave the plotter open
with .show(auto_close=False)
. You may also have to set
pv.Plotter(off_screen=True)
Note
Use lighting=False
to reduce the size of the color space to avoid
“jittery” GIFs when showing the scalar bar.
import pyvista as pv
from pyvista import examples
mesh = examples.download_st_helens().warp_by_scalar()
Orbit around the Mt. St Helens dataset.
p = pv.Plotter()
p.add_mesh(mesh, lighting=False)
p.camera.zoom(1.5)
p.show(auto_close=False)
path = p.generate_orbital_path(n_points=36, shift=mesh.length)
p.open_gif("orbit.gif")
p.orbit_on_path(path, write_frames=True)
p.close()
![orbit](https://d33wubrfki0l68.cloudfront.net/eb914858eab6fcf30a0f8153888ec40d1069200a/28a3c/_images/sphx_glr_orbit_001.gif)
![orbit](https://d33wubrfki0l68.cloudfront.net/9080c155302a5a56124811179d3db2b8f830faea/1c301/_images/sphx_glr_orbit_002.gif)
mesh = examples.download_dragon()
viewup = [0, 1, 0]
![orbit](https://d33wubrfki0l68.cloudfront.net/af8c6efbf2d7ef99a1a76f1955b6e526e55dde66/83945/_images/sphx_glr_orbit_003.gif)
Total running time of the script: (0 minutes 57.580 seconds)