pogona.Transformation
- class pogona.Transformation(translation: ndarray = array([0, 0, 0]), rotation: ndarray = array([0, 0, 0]), scaling: ndarray = array([1, 1, 1]), matrix: Optional[ndarray] = None, direction_matrix: Optional[ndarray] = None, rotation_order: str = 'XYZ')[source]
Bases:
object
Attributes
If true, this transformation was initialized with a given matrix, which means we don't know the translation, rotation, or scale for sure.
- __init__(translation: ndarray = array([0, 0, 0]), rotation: ndarray = array([0, 0, 0]), scaling: ndarray = array([1, 1, 1]), matrix: Optional[ndarray] = None, direction_matrix: Optional[ndarray] = None, rotation_order: str = 'XYZ')[source]
Scaling is applied first, then rotation, then translation!
- Parameters
translation –
rotation – Rotation vector in radians.
scaling –
matrix – Instead of translation, rotation and scaling, provide combined matrix instead
direction_matrix – Must be given together with matrix.
rotation_order – Order for computing the rotation matrix. Blender’s default is also ‘XYZ’.
Methods
__init__
([translation, rotation, scaling, ...])Scaling is applied first, then rotation, then translation!
apply_inverse_to_point
(point)apply_inverse_to_points
(points)apply_to_direction
(vec)apply_to_directions
(vecs)apply_to_point
(point)apply_to_points
(points)apply_to_transformation
(other)Works as if you were to first apply other to a point, then this transformation afterwards.
- __init__(translation: ndarray = array([0, 0, 0]), rotation: ndarray = array([0, 0, 0]), scaling: ndarray = array([1, 1, 1]), matrix: Optional[ndarray] = None, direction_matrix: Optional[ndarray] = None, rotation_order: str = 'XYZ')[source]
Scaling is applied first, then rotation, then translation!
- Parameters
translation –
rotation – Rotation vector in radians.
scaling –
matrix – Instead of translation, rotation and scaling, provide combined matrix instead
direction_matrix – Must be given together with matrix.
rotation_order – Order for computing the rotation matrix. Blender’s default is also ‘XYZ’.
- apply_to_transformation(other: Transformation)[source]
Works as if you were to first apply other to a point, then this transformation afterwards.
- property direction_matrix: ndarray
- property inverse_direction_matrix: ndarray
- property inverse_matrix: ndarray
- property matrix: ndarray
- property rotation: ndarray
- property scaling: ndarray
- property translation: ndarray
- property was_set_from_matrix
If true, this transformation was initialized with a given matrix, which means we don’t know the translation, rotation, or scale for sure.