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 | دوران الفضاء العالمي كـ 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اسم الخاصية علىGlobalTransformهوscale(ليسscaling). المحليTransformيستخدمscalingلخاصية المقياس القابلة للكتابة.