- Qt 6.4
- Qt 3D
- QML Types
- Qt3D.Core
- Transform
- Qt 6.4.3 Reference Documentation

# Transform QML Type

Used to perform transforms on meshes. More...

Import Statement: | import Qt3D.Core 2.4
Since: | Qt 5.6
Inherits: | Component3D

- List of all members, including inherited members

## Properties

- matrix : matrix4x4
- rotation : quaternion
- rotationX : real
- rotationY : real
- rotationZ : real
- scale : real
- scale3D : vector3d
- translation : vector3d

## Methods

- quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2, vector3d axis3, real angle3)
- quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2)
- quaternion fromAxisAndAngle(real x, real y, real z, real angle)
- quaternion fromAxisAndAngle(vector3d axis, real angle)
- quaternion fromEulerAngles(real pitch, real yaw, real roll)
- quaternion fromEulerAngles(vector3d eulerAngles)
- matrix4x4 rotateAround(vector3d point, real angle, vector3d axis)

## Detailed Description

The Transform component is not shareable between multiple Entity's. The transformation is held as vector3d scale, quaternion rotation and vector3d translation components. The transformations are applied to the mesh in that order. When Transform::matrix property is set, it is decomposed to these transform components and corresponding transform signals are emitted.

Several helper functions are provided to set up the Transform; 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.

## Property Documentation

matrix : matrix4x4

Holds the matrix4x4 of the transform.

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

rotation : quaternion

Holds the rotation of the transform as quaternion.

rotationX : real

Holds the x rotation of the transform as Euler angle.

rotationY : real

Holds the y rotation of the transform as Euler angle.

rotationZ : real

Holds the z rotation of the transform as Euler angle.

scale : real

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

scale3D : vector3d

Holds the scale of the transform as vector3d.

translation : vector3d

Holds the translation of the transform as vector3d.

## Method Documentation

quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2, vector3d axis3, real angle3)

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

quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2)

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

quaternion fromAxisAndAngle(real x, real y, real z, real angle)

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

quaternion fromAxisAndAngle(vector3d axis, real angle)

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

quaternion fromEulerAngles(real pitch, real yaw, real roll)

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

quaternion fromEulerAngles(vector3d eulerAngles)

Creates a quaternion from eulerAngles. Returns the resulting quaternion.

matrix4x4 rotateAround(vector3d point, real angle, vector3d axis)

Creates a rotation matrix from axis and angle around point relative to local origin. Returns the resulting matrix4x4.