pyvista.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
Rotation
objects.This method may be used as an alternative for setting the
orientation
.- Parameters:
- rotation
RotationLike
3x3 rotation matrix or a SciPy
Rotation
object.
- rotation
Examples
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, -89.99999999999999)