Transform class

Transform class

A transform contains information that allow access to object’s translate/scale/rotation or transform matrix at minimum cost This is used by local transform.

Inheritance: TransformA3DObject

The Transform type exposes the following members:

Properties

PropertyDescription
nameGets or sets the name.
propertiesGets the collection of all properties.
geometric_translationGets or sets the geometric translation.
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
geometric_scalingGets or sets the geometric scaling.
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
geometric_rotationGets or sets the geometric Euler rotation(measured in degree).
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
translationGets or sets the translation
scalingGets or sets the scaling
scaling_offsetGets or sets the scaling offset
scaling_pivotGets or sets the scaling pivot
pre_rotationGets or sets the pre-rotation represented in degree
rotation_offsetGets or sets the rotation offset
rotation_pivotGets or sets the rotation pivot
post_rotationGets or sets the post-rotation represented in degree
euler_anglesGets or sets the rotation represented in Euler angles, measured in degree
rotationGets or sets the rotation represented in quaternion.
transform_matrixGets or sets the transform matrix.

Methods

MethodDescription
remove_property(self, property)Removes a dynamic property.
remove_property(self, property)Remove the specified property identified by name
get_property(self, property)Get the value of specified property
set_property(self, property, value)Sets the value of specified property
find_property(self, property_name)Finds the property.
It can be a dynamic property (Created by CreateDynamicProperty/SetProperty)
or native property(Identified by its name)
set_geometric_translation(self, x, y, z)Sets the geometric translation.
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
set_geometric_scaling(self, sx, sy, sz)Sets the geometric scaling.
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
set_geometric_rotation(self, rx, ry, rz)Sets the geometric Euler rotation(measured in degree).
Geometric transformation only affects the entities attached and leave the child nodes unaffected.
It will be merged as local transformation when you export the geometric transformation to file types that does not support it.
set_translation(self, tx, ty, tz)Sets the translation of current transform.
set_scale(self, sx, sy, sz)Sets the scale of current transform.
set_euler_angles(self, rx, ry, rz)Sets the Euler angles in degrees of current transform.
set_rotation(self, rw, rx, ry, rz)Sets the rotation(as quaternion components) of current transform.
set_pre_rotation(self, rx, ry, rz)Sets the pre-rotation represented in degree
set_post_rotation(self, rx, ry, rz)Sets the post-rotation represented in degree

Example

The following code shows how to change the transform of the node:

from aspose.threed import Scene
from aspose.threed.entities import Box
from aspose.threed.utilities import Vector3

scene = Scene()
boxNode = scene.root_node.create_child_node(Box())
# place the box at (10, 0, 0)
boxNode.transform.translation = Vector3(10, 0, 0)

See Also