QTransform

Used to perform transforms on meshes. More

Inheritance diagram of PySide6.Qt3DCore.Qt3DCore.QTransform

Synopsis

Functions

Slots

Signals

Static functions

Detailed Description

The QTransform component is not shareable between multiple QEntity ‘s. The transformation is held as QVector3D scale, QQuaternion rotation and QVector3D translation components. The transformations are applied to the mesh in that order. When matrix property is set, it is decomposed to these transform components and corresponding signals are emitted.

Several helper functions are provided to set up the QTransform ; fromAxisAndAngle and fromAxesAndAngles can be used to set the rotation around specific axes, fromEulerAngles can be used to set the rotation based on euler angles and rotateAround can be used to rotate the object around specific point relative to local origin.

class PySide6.Qt3DCore.Qt3DCore.QTransform([parent=None])
Parameters

parentPySide6.Qt3DCore.Qt3DCore.QNode

Constructs a new QTransform with parent.

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxes(xAxis, yAxis, zAxis)
Parameters
Return type

PySide6.QtGui.QQuaternion

Creates a QQuaterniom definining a rotation from the axes xAxis, yAxis and zAxis.

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2)
Parameters
Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from axis1, angle1, axis2, and angle2. Returns the resulting QQuaternion .

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)
Parameters
Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from axis1, angle1, axis2, angle2, axis3, and angle3. Returns the resulting QQuaternion .

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(axis, angle)
Parameters
Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from axis and angle. Returns the resulting QQuaternion .

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(x, y, z, angle)
Parameters
  • x – float

  • y – float

  • z – float

  • angle – float

Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from x, y, z, and angle. Returns the resulting QQuaternion .

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(eulerAngles)
Parameters

eulerAnglesPySide6.QtGui.QVector3D

Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from eulerAngles. Returns the resulting QQuaternion .

static PySide6.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(pitch, yaw, roll)
Parameters
  • pitch – float

  • yaw – float

  • roll – float

Return type

PySide6.QtGui.QQuaternion

Creates a QQuaternion from pitch, yaw, and roll. Returns the resulting QQuaternion .

PySide6.Qt3DCore.Qt3DCore.QTransform.matrix()
Return type

PySide6.QtGui.QMatrix4x4

Holds the QMatrix4x4 of the transform.

Note

When the matrix property is set, it is decomposed to translation, rotation and scale components.

PySide6.Qt3DCore.Qt3DCore.QTransform.matrixChanged()
static PySide6.Qt3DCore.Qt3DCore.QTransform.rotateAround(point, angle, axis)
Parameters
Return type

PySide6.QtGui.QMatrix4x4

Creates a rotation matrix from axis and angle around point. Returns the resulting QMatrix4x4 .

static PySide6.Qt3DCore.Qt3DCore.QTransform.rotateFromAxes(xAxis, yAxis, zAxis)
Parameters
Return type

PySide6.QtGui.QMatrix4x4

Returns a rotation matrix defined from the axes xAxis, yAxis, zAxis.

PySide6.Qt3DCore.Qt3DCore.QTransform.rotation()
Return type

PySide6.QtGui.QQuaternion

Holds the rotation of the transform as QQuaternion .

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationChanged(rotation)
Parameters

rotationPySide6.QtGui.QQuaternion

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationX()
Return type

float

Holds the x rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationXChanged(rotationX)
Parameters

rotationX – float

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationY()
Return type

float

Holds the y rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationYChanged(rotationY)
Parameters

rotationY – float

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationZ()
Return type

float

Holds the z rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.rotationZChanged(rotationZ)
Parameters

rotationZ – float

PySide6.Qt3DCore.Qt3DCore.QTransform.scale()
Return type

float

Holds the uniform scale of the transform. If the scale has been set with setScale3D , holds the x value only.

PySide6.Qt3DCore.Qt3DCore.QTransform.scale3D()
Return type

PySide6.QtGui.QVector3D

Holds the scale of the transform as QVector3D .

PySide6.Qt3DCore.Qt3DCore.QTransform.scale3DChanged(scale)
Parameters

scalePySide6.QtGui.QVector3D

PySide6.Qt3DCore.Qt3DCore.QTransform.scaleChanged(scale)
Parameters

scale – float

PySide6.Qt3DCore.Qt3DCore.QTransform.setMatrix(matrix)
Parameters

matrixPySide6.QtGui.QMatrix4x4

Holds the QMatrix4x4 of the transform.

Note

When the matrix property is set, it is decomposed to translation, rotation and scale components.

PySide6.Qt3DCore.Qt3DCore.QTransform.setRotation(rotation)
Parameters

rotationPySide6.QtGui.QQuaternion

Holds the rotation of the transform as QQuaternion .

PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationX(rotationX)
Parameters

rotationX – float

Holds the x rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationY(rotationY)
Parameters

rotationY – float

Holds the y rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationZ(rotationZ)
Parameters

rotationZ – float

Holds the z rotation of the transform as Euler angle.

PySide6.Qt3DCore.Qt3DCore.QTransform.setScale(scale)
Parameters

scale – float

Holds the uniform scale of the transform. If the scale has been set with setScale3D , holds the x value only.

PySide6.Qt3DCore.Qt3DCore.QTransform.setScale3D(scale)
Parameters

scalePySide6.QtGui.QVector3D

Holds the scale of the transform as QVector3D .

PySide6.Qt3DCore.Qt3DCore.QTransform.setTranslation(translation)
Parameters

translationPySide6.QtGui.QVector3D

Holds the translation of the transform as QVector3D .

PySide6.Qt3DCore.Qt3DCore.QTransform.translation()
Return type

PySide6.QtGui.QVector3D

Holds the translation of the transform as QVector3D .

PySide6.Qt3DCore.Qt3DCore.QTransform.translationChanged(translation)
Parameters

translationPySide6.QtGui.QVector3D

PySide6.Qt3DCore.Qt3DCore.QTransform.worldMatrix()
Return type

PySide6.QtGui.QMatrix4x4

Holds the world transformation matrix for the transform. This assumes the QTransform component is being referenced by a QEntity . This makes it more convenient to identify when a QEntity part of a subtree has been transformed in the world even though its local transformation might not have changed.

PySide6.Qt3DCore.Qt3DCore.QTransform.worldMatrixChanged(worldMatrix)
Parameters

worldMatrixPySide6.QtGui.QMatrix4x4