GlobalTransform – Aspose.3D FOSS for Java
Prehľad
GlobalTransform predstavuje: iba pre čítanie Svetový priestor transformácie scény uzlov. Je získaný volaním node.getGlobalTransform() a odráža kumulatívny účinok všetkých predkov transformácií zo scény koreň dolú do uzla.
Balík:: com.aspose.threed
Všetky vlastnosti sú iba pre čítanie. Ak chcete zmeniť polohu alebo orientáciu uzla, upravte zapisovateľnosť uzlu Transform namiesto toho.
Odkaz na triedu
| Class | Description |
|---|---|
GlobalTransform | Read-only world-space transform snapshot. Exposes the composed translation, rotation, scale, and matrix of a node in world space. |
| Name | Type | Access | Description |
|---|---|---|---|
translation | Vector3 | Read | Returns the world-space translation (position) of the node. |
rotation | Vector3 | Read | Returns the world-space rotation (Euler angles) of the node. |
scale | Vector3 | Read | Returns the world-space scale of the node. |
transformMatrix | Matrix4 | Read | Returns the full 4x4 world-space transformation matrix. |
| Signature | Description |
|---|---|
getTranslation() to Vector3 | Returns the world-space translation of the node. |
getRotation() to Vector3 | Returns the world-space rotation of the node. |
getScale() to Vector3 | Returns the world-space scale of the node. |
getTransformMatrix() to Matrix4 | Returns the full 4x4 world-space transformation matrix. |
Rýchly príklad
import com.aspose.threed.Node;
import com.aspose.threed.GlobalTransform;
Node child = scene.getRootNode().createChildNode("child");
GlobalTransform gt = child.getGlobalTransform();
System.out.println(gt.getTranslation()); // world-space position
System.out.println(gt.getTransformMatrix()); // full 4x4 matrix