GlobalTransform

GlobalTransform

Methods

GlobalTransform読み取り専用 のスナップショット Nodeのワールド空間変換です。これは以下を使用して取得されます node.global_transform そして、ノード自身の Transform をシーンルートまでのすべての祖先の変換と合成したものを反映します。.

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

Methods: aspose.threed

from aspose.threed import GlobalTransform

GlobalTransform は通常直接インスタンス化されません;次から受け取ります node.global_transform.

Methods

MethodsMethodsMethods
translationVector3ノードのワールド空間位置
scaleVector3ノードのワールド空間スケール
rotationQuaternionクォータニオンとしてのワールド空間回転
euler_anglesVector3ラジアン単位のオイラー角としてのワールド空間回転 (roll, pitch, yaw)
transform_matrixMatrix4完全な4×4ワールド空間変換行列

Methods

from aspose.threed import Scene
from aspose.threed.utilities import Vector3
import math

scene = Scene()

# Create a parent node at (10, 0, 0)
parent = scene.root_node.create_child_node("parent")
parent.transform.translation = Vector3(10.0, 0.0, 0.0)

# Create a child node at (5, 0, 0) relative to parent
child = parent.create_child_node("child")
child.transform.translation = Vector3(5.0, 0.0, 0.0)

# Read world-space position
gt = child.global_transform
print(gt.translation)          # Vector3(15.0, 0.0, 0.0)
print(gt.scale)                # Vector3(1.0, 1.0, 1.0)

# Access the 4x4 matrix directly
mat = gt.transform_matrix
print(mat.m03)   # 15.0 — world-space X translation

# Euler angles in degrees
angles = gt.euler_angles
print(math.degrees(angles.x))   # 0.0 (no rotation)

# Using evaluate_global_transform to include geometric offset
manual_mat = child.evaluate_global_transform(True)

Methods

  • GlobalTransform はその時点で計算されます node.global_transform がアクセスされます; それは なし 親ノードのものが動的に更新される場合 Transform 後の変更。.
  • Methods scale 上のプロパティ名 GlobalTransform です scale (なし scaling). ローカル Transform 使用します scaling 書き込み可能なスケールプロパティのために。.

関連項目

 日本語