Matrix4 — Aspose.3D FOSS for Java

FbxSaveOptions

Matrix4 는 4x4 이중 정밀도 행렬이며 3D 공간에서 어파인 변환에 사용됩니다. 이는 다음에 의해 반환됩니다 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);

참고

 한국어