# Transform QML Type

Used to perform transforms on meshes More...

Import Statement: | import Qt3D.Core 2.0 |

Since: | Qt 5.6 |

Instantiates: | QTransform |

Inherits: |

## Properties

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

## Methods

- quaternion
(vector3d**fromAxesAndAngles***axis1*, real*angle1*, vector3d*axis2*, real*angle2*, vector3d*axis3*, real*angle3*) - quaternion
(vector3d**fromAxesAndAngles***axis1*, real*angle1*, vector3d*axis2*, real*angle2*) - quaternion
(real**fromAxisAndAngle***x*, real*y*, real*z*, real*angle*) - quaternion
(vector3d**fromAxisAndAngle***axis*, real*angle*) - quaternion
(real**fromEulerAngles***pitch*, real*yaw*, real*roll*) - quaternion
(vector3d**fromEulerAngles***eulerAngles*) - matrix4x4
(vector3d**rotateAround***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

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

quaternion fromAxesAndAngles(vector3d |

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

quaternion fromAxisAndAngle(real |

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

quaternion fromAxisAndAngle(vector3d |

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

quaternion fromEulerAngles(real |

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

quaternion fromEulerAngles(vector3d |

Creates a quaternion from *eulerAngles*. Returns the resulting quaternion.

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

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.