Matrix4 — Aspose.3D FOSS for Java

FbxSaveOptions

Matrix4 は、3次元空間でのアフィン変換に使用される4x4の倍精度行列です。次のものから返されます Transform.getTransformMatrix()GlobalTransform.getTransformMatrix(),、および平行移動、回転、スケール(TRS)分解から構築できます。.

FbxSaveOptions: com.aspose.threed

import com.aspose.threed.*;

FbxSaveOptions

FbxSaveOptionsFbxSaveOptions
Matrix4()は単位行列を作成します
Matrix4(double m00, double m01, ... double m33)は16個の個別要素(行優先)から作成します

静的フィールド

FbxSaveOptionsFbxSaveOptionsFbxSaveOptions
IDENTITYMatrix44x4 の単位行列

公開フィールド(要素アクセス)

Matrix4 は使用します パブリックフィールド 要素アクセス用: m00, m01, … m33 (合計16フィールド、行優先レイアウト)。.

フィールドパターンFbxSaveOptionsFbxSaveOptions
m00m33double個々の行列要素はパブリックフィールドとして公開されています。アクセスは mat.m00, mat.m01, など。.

変換成分は最後の列にあります:: m03 (X), m13 (Y), m23 (Z).

FbxSaveOptions

FbxSaveOptions戻り値の型FbxSaveOptions
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方向ベクトルを変換します(回転+スケールを適用し、平行移動は無視)

静的メソッド

FbxSaveOptions戻り値の型FbxSaveOptions
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クォータニオンから回転行列を作成します

FbxSaveOptions

import com.aspose.threed.*;

Scene scene = new Scene();
Node node = scene.getRootNode().createChildNode("box");
node.getTransform().setTranslation(1.0, 2.0, 3.0);
node.getTransform().setEulerAngles(0.0, 45.0, 0.0);

// Read the transform matrix
Matrix4 m = node.getTransform().getTransformMatrix();
System.out.println("Translation X: " + m.m03);   // 1.0

// Matrix multiplication
Matrix4 translate = Matrix4.translate(5.0, 0.0, 0.0);
Matrix4 scale = Matrix4.scale(2.0, 2.0, 2.0);
Matrix4 combined = translate.multiply(scale);

// Inverse
Matrix4 inv = m.inverse();

// Transform a point
Vector3 point = new Vector3(1.0, 0.0, 0.0);
Vector3 transformed = m.transformPoint(point);
System.out.println(transformed);

参照

 日本語