Matrix4 class
Matrix4 class
4x4 matrix implementation.
The Matrix4 type exposes the following members:
Constructors
Constructor | Description |
---|
__init__(self, r0, r1, r2, r3) | Constructs matrix from 4 rows. |
__init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) | Initializes a new instance of the Matrix4 struct. |
__init__(self, m) | Construct Matrix4 from an FMatrix4 instance |
__init__(self, m) | Initializes a new instance of the Matrix4 struct. |
__init__(self) | Constructs a new instance of Matrix4 |
Properties
Methods
Method | Description |
---|
translate(, t) | Creates a matrix that translates along the x-axis, the y-axis and the z-axis |
translate(, tx, ty, tz) | Creates a matrix that translates along the x-axis, the y-axis and the z-axis |
scale(, s) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
scale(, s) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
scale(, sx, sy, sz) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
rotate_from_euler(, eul) | Create a rotation matrix from Euler angle |
rotate_from_euler(, rx, ry, rz) | Create a rotation matrix from Euler angle |
rotate(, angle, axis) | Create a rotation matrix by rotation angle and axis |
rotate(, q) | Create a rotation matrix from a quaternion |
concatenate(self, m2) | Concatenates the two matrices |
transpose(self) | Transposes this instance. |
normalize(self) | Normalizes this instance. |
inverse(self) | Inverses this instance. |
set_trs(self, translation, rotation, scale) | Initializes the matrix with translation/rotation/scale |
to_array(self) | Converts matrix to array. |
decompose(self, translation, scaling, rotation) | |
Example
from aspose.threed.utilities import Matrix4, Vector4
mat = Matrix4.rotate_from_euler(90, 0, 0)
mat2 = Matrix4.translate(0, 10, -50)
transform = mat2 * mat
pos = Vector4(10, 9, 0, 1)
transformed = transform * pos
See Also