pyvista.plotting.widgets.WidgetHelper.add_camera3d_widget

pyvista.plotting.widgets.WidgetHelper.add_camera3d_widget#

WidgetHelper.add_camera3d_widget()[source]#

Add a camera3d widget allow to move the camera.

Note

This widget requires vtk>=9.3.0.

Returns:
vtkCamera3DWidget

The camera3d widget.

Examples

Add a camera3d widget to the scene.

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> plotter = pv.Plotter(shape=(1, 2))
>>> _ = plotter.add_mesh(sphere, show_edges=True)
>>> plotter.subplot(0, 1)
>>> _ = plotter.add_mesh(sphere, show_edges=True)
>>> _ = plotter.add_camera3d_widget()
>>> plotter.show(cpos=plotter.camera_position)
../../../_images/pyvista-plotting-widgets-WidgetHelper-add_camera3d_widget-1_00_00.png