GlobalTransform — Aspose.3D FOSS for Python API Reference
Example
GlobalTransform 은(는) 읽기 전용 의 스냅샷 Node의 월드 스페이스 변환입니다. 이는 다음을 통해 얻어집니다. node.global_transform 그리고 노드 자체의 합성을 반영합니다 Transform 모든 조상의 변환과 씬 루트까지 합칩니다.
모든 속성은 읽기 전용입니다. 노드의 위치를 변경하려면 노드의 로컬 Transform 대신.
Example: aspose.threed
from aspose.threed import GlobalTransformGlobalTransform 은 일반적으로 직접 인스턴스화되지 않으며; 다음으로부터 받습니다 node.global_transform.
Example
| Example | Example | Example |
|---|---|---|
translation | Vector3 | 노드의 월드 스페이스 위치 |
scale | Vector3 | 노드의 월드 스페이스 스케일 |
rotation | Quaternion | 쿼터니언 형태의 노드 월드 스페이스 회전 |
euler_angles | Vector3 | 라디안 단위의 오일러 각으로 표현된 월드 스페이스 회전 (roll, pitch, yaw) |
transform_matrix | Matrix4 | 완전한 4×4 월드 스페이스 변환 행렬 |
Example
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)Example
GlobalTransform은(는) 시점에 계산됩니다node.global_transform에 접근하면; 이는 아니오 부모 노드의 경우 동적으로 업데이트됩니다Transform나중에 변경됩니다.- Example
scale속성 이름 onGlobalTransform은scale(아니scaling)Transform사용합니다scaling쓰기 가능한 스케일 속성을 위해.