GlobalTransform

GlobalTransform — Aspose.3D FOSS for Java

Methods

GlobalTransform読み取り専用 のスナップショット Nodeのワールド空間変換です。これは~によって取得されます node.getGlobalTransform() そして、ノード自身の Transform シーンルートまでのすべての祖先の変換と組み合わせたものです。.

すべてのプロパティは読み取り専用です。ノードの位置を変更するには、ノードのローカル Transform 代わりに。.

Methods: com.aspose.threed

import com.aspose.threed.GlobalTransform;

GlobalTransform は通常直接インスタンス化されません; それは~から受け取ります node.getGlobalTransform().

Methods

MethodsMethodsMethodsMethods
translationVector3getTranslation()ノードのワールド空間位置
scaleVector3getScale()ノードのワールド空間スケール
rotationQuaterniongetRotation()ワールド空間の回転をクォータニオンとして
eulerAnglesVector3getEulerAngles()ワールド空間の回転をラジアン単位のオイラー角として (roll, pitch, yaw)
transformMatrixMatrix4getTransformMatrix()完全な4x4ワールド空間変換行列

Methods

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

Methods

  • GlobalTransform はその時点で計算されます node.getGlobalTransform() にアクセスされます;それは ではありません 親ノードの…がある場合、動的に更新され Transform 後の変更.
  • ゲッターは getScale()GlobalTransform (ではない getScaling()). ローカル Transform 使用します getScaling() 書き込み可能なスケールプロパティ用に。.

関連項目

 日本語