Matrix4 — Aspose.3D FOSS for Java

FbxSaveOptions

Matrix4 एक 4x4 double-precision मैट्रिक्स है जो 3D स्पेस में affine transformations के लिए उपयोग किया जाता है। यह द्वारा लौटाया जाता है Transform.getTransformMatrix() और GlobalTransform.getTransformMatrix(), और translation, rotation, और scale (TRS) डीकम्पोज़िशन से निर्मित किया जा सकता है।.

FbxSaveOptions: com.aspose.threed

import com.aspose.threed.*;

FbxSaveOptions

FbxSaveOptionsFbxSaveOptions
Matrix4()एक identity मैट्रिक्स बनाता है
Matrix4(double m00, double m01, ... double m33)16 व्यक्तिगत तत्वों (row-major) से बनाता है

स्थैतिक फ़ील्ड्स

FbxSaveOptionsFbxSaveOptionsFbxSaveOptions
IDENTITYMatrix44x4 identity मैट्रिक्स

सार्वजनिक फ़ील्ड्स (तत्व पहुँच)

Matrix4 का उपयोग करता है public फ़ील्ड्स तत्व पहुँच के लिए: 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घटकों से scale matrix बनाता है
Matrix4.rotateFromQuaternion(Quaternion q)Matrix4quaternion से rotation matrix बनाता है

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);

संबंधित देखें

 हिन्दी