GlobalTransform

GlobalTransform — Aspose.3D FOSS for Python API Reference

Enumerations

GlobalTransform एक है केवल-पढ़ने योग्य का स्नैपशॉट Node’s विश्व-स्थान परिवर्तन। इसे प्राप्त किया जाता है द्वारा node.global_transform और प्रतिबिंबित करता है नोड के अपने Transform सीन रूट तक प्रत्येक पूर्वज के ट्रांसफ़ॉर्म के साथ।.

सभी गुण केवल-पढ़ने योग्य हैं। नोड की स्थिति बदलने के लिए, नोड के स्थानीय Transform के बजाय।.

Enumerations: aspose.threed

from aspose.threed import GlobalTransform

GlobalTransform सामान्यतः सीधे इंस्टैंशिएट नहीं किया जाता; आप इसे … से प्राप्त करते हैं node.global_transform.

Enumerations

EnumerationsEnumerationsEnumerations
translationVector3नोड की विश्व-स्थान स्थिति
scaleVector3नोड का विश्व-स्थान स्केल
rotationQuaternionक्वाटरनियन के रूप में विश्व-स्थान घूर्णन
euler_anglesVector3रैडियन में यूलेर कोणों के रूप में विश्व-स्थान घूर्णन (roll, pitch, yaw)
transform_matrixMatrix4पूर्ण 4×4 विश्व-स्थान रूपांतरण मैट्रिक्स

Enumerations

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)

Enumerations

  • GlobalTransform समय पर गणना किया जाता है node.global_transform पहुंचा जाता है; यह है नहीं यदि किसी पैरेंट नोड का Transform बाद में परिवर्तन होता है।.
  • Enumerations scale पर गुण का नाम GlobalTransform है scale (नहीं scaling). स्थानीय Transform का उपयोग करता है scaling लिखने योग्य स्केल गुण के लिए।.

संबंधित देखें

 हिन्दी