pyvista.Prop3D.rotation_from#
- Prop3D.rotation_from(rotation: pyvista.RotationLike) None [ソース]#
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
.Added in version 0.45.
- パラメータ:
- rotation
RotationLike
3x3 の回転行列,または SciPy の
Rotation
オブジェクト。
- rotation
例
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)