# Examples from pyvista.Plotter.view_vector
# =========================================

# View a sphere from the positive x-axis. The camera looks in the
# negative x direction.
import pyvista as pv
pl = pv.Plotter()
_ = pl.add_mesh(pv.Sphere())
pl.view_vector([1, 0, 0])
pl.camera.direction

# View a built-in mesh from the `(1, 1, 1)` direction. The camera is
# placed along this vector and looks back toward the center of the mesh,
# so the positive x, y and z axes all point toward the viewer.
from pyvista import examples
airplane = examples.load_airplane()
pl = pv.Plotter()
_ = pl.add_mesh(airplane)
pl.view_vector([1, 1, 1])
pl.show_axes()
pl.show()

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