TransformBuilder class

TransformBuilder class

The TransformBuilder is used to build transform matrix by a chain of transformations.

The TransformBuilder type exposes the following members:

Constructors

ConstructorDescription
initConstruct a TransformBuilder with initial transform matrix and specified compose order
initConstruct a TransformBuilder with initial identity transform matrix and specified compose order

Properties

PropertyDescription
matrixGets or sets the current matrix value
compose_orderGets or sets the chain compose order.

Methods

MethodDescription
scaleChain a scaling transform matrix with a component scaled by s
scaleChain a scaling transform matrix
scaleChain a scale transform
rotate_degreeChain a rotation transform in degree
rotate_degreeAppend rotation with specified order
rotate_radianChain a rotation transform in radian
rotate_radianAppend rotation with specified order
rotate_euler_radianChain a rotation by Euler angles in radian
rotate_euler_radianChain a rotation by Euler angles in radian
translateChain a translation transform
translateChain a translation transform
composeAppend or prepend the argument to internal matrix.
appendAppend the new transform matrix to the transform chain.
prependPrepend the new transform matrix to the transform chain.
rearrangeRearrange the layout of the axis.
rotateChain a rotation by a quaternion
rotate_euler_degreeChain a rotation by Euler angles in degree
resetReset the transform to identity matrix

Example

The following code shows how to create a matrix by a set of operation

from aspose.threed.utilities import TransformBuilder

tb = TransformBuilder()
tb.translate(10, 20, 0)
tb.scale(10, 10, 10)
tb.rotate_euler_degree(90, 0, 0)
print(f"Transform Matrix: {tb.matrix}")

See Also