blenderproc.math package
Module contents
- blenderproc.math.build_transformation_mat(translation, rotation)
Build a transformation matrix from translation and rotation parts.
- Parameters:
translation (
Union
[ndarray
,List
[float
],Vector
]) – A (3,) vector representing the translation part.rotation (
Union
[ndarray
,List
[List
[float
]],Matrix
]) – A 3x3 rotation matrix or Euler angles of shape (3,).
- Return type:
ndarray
- Returns:
The 4x4 transformation matrix.
- blenderproc.math.change_coordinate_frame_of_point(point, new_frame)
Transforms the given point into another coordinate frame.
Example: [1, 2, 3] and [“X”, “-Z”, “Y”] => [1, -3, 2]
- Parameters:
point (
Union
[ndarray
,List
[float
],Vector
]) – The point to convert in form of a np.ndarray, list or mathutils.Vector.new_frame (
List
[str
]) – An array containing three elements, describing each axis of the new coordinate frame based on the axes of the current frame. Available: [“X”, “Y”, “Z”, “-X”, “-Y”, “-Z”].
- Return type:
ndarray
- Returns:
The converted point also in form of a np.ndarray
- blenderproc.math.change_source_coordinate_frame_of_transformation_matrix(matrix, new_frame)
Changes the coordinate frame the given transformation matrix is mapping from.
Given a matrix $T_A^B$ that maps from A to B, this function can be used to change the axes of A into A’ and therefore end up with $T_A’^B$.
- Parameters:
matrix (
Union
[ndarray
,Matrix
]) – The matrix to convert in form of a np.ndarray or mathutils.Matrixnew_frame (
list
) – An array containing three elements, describing each axis of the new coordinate frame based on the axes of the current frame. Available: [“X”, “Y”, “Z”, “-X”, “-Y”, “-Z”].
- Return type:
ndarray
- Returns:
The converted matrix is in form of a np.ndarray
- blenderproc.math.change_target_coordinate_frame_of_transformation_matrix(matrix, new_frame)
Changes the coordinate frame the given transformation matrix is mapping to.
Given a matrix $T_A^B$ that maps from A to B, this function can be used to change the axes of B into B’ and therefore end up with $T_A^B’$.
- Parameters:
matrix (
Union
[ndarray
,Matrix
]) – The matrix to convert in form of a np.ndarray or mathutils.Matrixnew_frame (
List
[str
]) – An array containing three elements, describing each axis of the new coordinate frame based on the axes of the current frame. Available: [“X”, “Y”, “Z”, “-X”, “-Y”, “-Z”].
- Return type:
ndarray
- Returns:
The converted matrix is in form of a np.ndarray