Prop3D.rotation_from#
- Prop3D.rotation_from(rotation: pyvista.RotationLike) None[source]#
Set the entity’s orientation from a rotation.
Set the rotation of this entity from a 3x3 rotation matrix. This includes NumPy arrays, a vtkMatrix3x3, and SciPy
Rotationobjects.This method may be used as an alternative for setting the
orientation.Added in version 0.45.
- Parameters:
- rotation
RotationLike 3x3 rotation matrix or a SciPy
Rotationobject.
- rotation
Examples#
Download Python source code | Download Jupyter notebook
Create an actor and show its initial orientation.
>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(pv.Sphere())
>>> actor.orientation
(0.0, -0.0, 0.0)
Set the orientation using a 3x3 matrix.
>>> actor.rotation_from([[0, 1, 0], [1, 0, 0], [0, 0, 1]])
>>> actor.orientation
(0.0, -180.0, -90.0)