GlobalTransform

GlobalTransform – Aspose.3D FOSS for Java

Notes

GlobalTransform एक है read-only snapshot का Node’s world-space transformation. यह प्राप्त किया जाता है via node.getGlobalTransform() और दर्शाता है node की अपनी Transform हर ancestor के transform के साथ scene root तक.

सभी गुण read-only हैं। node की position बदलने के लिए, node के local Transform के बजाय।.

Notes: com.aspose.threed

import com.aspose.threed.GlobalTransform;

GlobalTransform आमतौर पर सीधे इंस्टैंसिएट नहीं किया जाता; आप इसे … से प्राप्त करते हैं node.getGlobalTransform().

Notes

ClassDescription
GlobalTransformRead-only world-space transform snapshot. Exposes the composed translation, rotation, scale, and matrix of a node in world space.
NameTypeAccessDescription
translationVector3ReadReturns the world-space translation (position) of the node.
rotationVector3ReadReturns the world-space rotation (Euler angles) of the node.
scaleVector3ReadReturns the world-space scale of the node.
transformMatrixMatrix4ReadReturns the full 4x4 world-space transformation matrix.
SignatureDescription
getTranslation() to Vector3Returns the world-space translation of the node.
getRotation() to Vector3Returns the world-space rotation of the node.
getScale() to Vector3Returns the world-space scale of the node.
getTransformMatrix() to Matrix4Returns the full 4x4 world-space transformation matrix.

Notes

import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.GlobalTransform;
import com.aspose.threed.*;


Scene scene = new Scene();

// Create a parent node at (10, 0, 0)
Node parent = scene.getRootNode().createChildNode("parent");
parent.getTransform().setTranslation(new Vector3(10.0, 0.0, 0.0));

// Create a child node at (5, 0, 0) relative to parent
Node child = parent.createChildNode("child");
child.getTransform().setTranslation(new Vector3(5.0, 0.0, 0.0));

// Read world-space position
GlobalTransform gt = child.getGlobalTransform();
System.out.println(gt.getTranslation());          // Vector3(15.0, 0.0, 0.0)
System.out.println(gt.getScale());                 // Vector3(1.0, 1.0, 1.0)

// Access the 4x4 matrix directly
Matrix4 mat = gt.getTransformMatrix();
System.out.println(mat.m03);   // 15.0 -- world-space X translation

// Euler angles in degrees
Vector3 angles = gt.getEulerAngles();
System.out.println(Math.toDegrees(angles.x));   // 0.0 (no rotation)

// Using evaluateGlobalTransform to include geometric offset
Matrix4 manualMat = child.evaluateGlobalTransform(true);

Notes

  • GlobalTransform समय पर गणना किया जाता है node.getGlobalTransform() पहुँचा जाता है; यह है नहीं डायनामिक रूप से अपडेट किया जाता है यदि किसी पैरेंट नोड का Transform बाद में परिवर्तन।.
  • getter है getScale() पर GlobalTransform (नहीं getScaling()) Transform उपयोग करता है getScaling() लेखनीय स्केल प्रॉपर्टी के लिए।.

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

 हिन्दी