Example
Matrix4 este o matrice de precizie dublă 4x4 utilizată pentru transformări afine în spațiul 3D. Este returnată de Transform.getTransformMatrix() și GlobalTransform.getTransformMatrix(), și poate fi construit din descompuneri de translație, rotație și scară (TRS).
Example: com.aspose.threed
Example
| Example | Example |
|---|
Matrix4() | Construiește o matrice identitate |
Matrix4(double m00, double m01, ... double m33) | Se construiește din 16 elemente individuale (ordonare pe rând) |
Câmpuri statice
| Example | Example | Example |
|---|
IDENTITY | Matrix4 | Matricea identitate 4x4 |
Câmpuri publice (Acces la elemente)
Matrix4 folosește câmpuri publice pentru accesarea elementului: m00, m01, … m33 (16 câmpuri în total, dispunere pe rânduri).
| Model de câmp | Example | Example |
|---|
m00 … m33 | double | Elemente individuale ale matricei ca câmpuri publice. Accesați ca mat.m00, mat.m01, etc. |
Componentele de translație se află în ultima coloană: m03 (X), m13 (Y), m23 (Z).
Example
| Example | Tip de returnare | Example |
|---|
multiply(Matrix4 other) | Matrix4 | Înmulțire de matrice; returnează o matrice nouă |
inverse() | Matrix4 | Returnează matricea inversă |
transpose() | Matrix4 | Returnează matricea transpusă |
decompose(Vector3 translation, Vector3 scaling, Quaternion rotation) | boolean | Stub: întotdeauna returnează false. Intenționat să descompună matricea în componente TRS, dar nu este încă implementat. |
determinant() | double | Returnează determinantul matricei |
transformPoint(Vector3 point) | Vector3 | Transformă un punct (aplică translație completă + rotație + scalare) |
transformDirection(Vector3 direction) | Vector3 | Transformă un vector de direcție (aplică rotație + scalare, ignoră translația) |
Metode statice
| Example | Tip de returnare | Example |
|---|
Matrix4.translate(Vector3 t) | Matrix4 | Creează o matrice de translație |
Matrix4.translate(double x, double y, double z) | Matrix4 | Creează o matrice de translație din componente |
Matrix4.scale(Vector3 s) | Matrix4 | Creează o matrice de scalare |
Matrix4.scale(double x, double y, double z) | Matrix4 | Creează o matrice de scalare din componente |
Matrix4.rotateFromQuaternion(Quaternion q) | Matrix4 | Creează o matrice de rotație dintr-un quaternion |
Example
Vezi și