Quaternion QML Type | Qt Quick 3D (original) (raw)

Provides utility functions for quaternion. More...

Import Statement: import QtQuick3D

Methods

Detailed Description

The Quaternion is a global object with utility functions.

It is not instantiable; to use it, call the members of the global Quaternion object directly. For example:

Node { rotation: Quaternion.fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45) }

Method Documentation

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

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

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

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

Creates a quaternion from eulerAngles. Returns the resulting quaternion.

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

Creates a quaternion from sourcePosition, targetPosition, forwardDirection, and upDirection. This is used for getting a rotation value for pointing at a particular target, and can be used to point a camera at a position in a scene.

forwardDirection defaults to Qt.vector3d(0, 0, -1) upDirection defaults to Qt.vector3d(0, 1, 0)

Returns the resulting quaternion.

© 2025 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.