Example
Matrix4 是一个用于 3D 空间仿射变换的 4x4 双精度矩阵。它由以下函数返回: Transform.getTransformMatrix() 和 GlobalTransform.getTransformMatrix(),,并且可以通过平移、旋转和缩放(TRS)分解来构造。.
Example: com.aspose.threed
Example
| Example | Example |
|---|
Matrix4() | 构造一个单位矩阵 |
Matrix4(double m00, double m01, ... double m33) | 由 16 个单独元素构成(行主序) |
静态字段
| Example | Example | Example |
|---|
IDENTITY | Matrix4 | 4x4 单位矩阵 |
公共字段(元素访问)
Matrix4 使用 公共字段 用于元素访问:: m00, m01, … m33 (共 16 个字段,行主序布局)。.
| 字段模式 | Example | Example |
|---|
m00 … m33 | double | 将矩阵的各个元素作为公共字段。访问方式为 mat.m00, mat.m01,,等。. |
翻译组件位于最后一列:: m03 (X), m13 (Y), m23 (Z).
Example
| Example | 返回类型 | Example |
|---|
multiply(Matrix4 other) | Matrix4 | 矩阵乘法;返回一个新矩阵 |
inverse() | Matrix4 | 返回逆矩阵 |
transpose() | Matrix4 | 返回转置矩阵 |
decompose(Vector3 translation, Vector3 scaling, Quaternion rotation) | boolean | 存根:: 始终返回 false. 旨在将矩阵分解为 TRS 组件,但尚未实现。. |
determinant() | double | 返回矩阵的行列式 |
transformPoint(Vector3 point) | Vector3 | 变换一个点(应用完整的平移 + 旋转 + 缩放) |
transformDirection(Vector3 direction) | Vector3 | 变换方向向量(应用旋转 + 缩放,忽略平移) |
静态方法
| Example | 返回类型 | Example |
|---|
Matrix4.translate(Vector3 t) | Matrix4 | 创建平移矩阵 |
Matrix4.translate(double x, double y, double z) | Matrix4 | 从组件创建平移矩阵 |
Matrix4.scale(Vector3 s) | Matrix4 | 创建缩放矩阵 |
Matrix4.scale(double x, double y, double z) | Matrix4 | 从组件创建缩放矩阵 |
Matrix4.rotateFromQuaternion(Quaternion q) | Matrix4 | 从四元数创建旋转矩阵 |
Example
另见