Transform QML Type

用于对网格执行变换。更多

Import Statement: import Qt3D.Core 2.9
In C++: QTransform
Inherits:

Component3D

Status: Deprecated

属性

方法

详细说明

变换组件不可在多个实体之间共享。变换以向量 3d 缩放、四元数旋转和向量 3d 平移组件的形式保存。这些变换按顺序应用于网格。当Transform::matrix 属性被设置时,它将被分解为这些变换分量,并发出相应的变换信号。

我们提供了多个辅助函数来设置变换:fromAxisAndAnglefromAxesAndAngles 可用于设置绕特定轴的旋转,fromEulerAngles 可用于设置基于欧拉角的旋转,rotateAround 可用于设置对象绕相对于本地原点的特定点的旋转。

属性文档

matrix : matrix4x4

保存变换的矩阵 4x4。

注: 设置矩阵属性后,矩阵将分解为平移、旋转和缩放三个分量。


rotation : quaternion

以四元数形式保存变换的旋转。


rotationX : real

以欧拉角形式保存变换的 x 轴旋转。


rotationY : real

以欧拉角形式保存变换的 Y 轴旋转。


rotationZ : real

以欧拉角形式保存变换的 z 旋转角度。


scale : real

保持变换的统一比例。如果使用scale3D 设置了缩放比例,则只保留 x 值。


scale3D : vector3d

以向量 3d 的形式保存变换的比例。


translation : vector3d

以向量 3d 的形式保存变换的平移值。


方法文档

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

axis1,angle1,axis2, 和angle2 创建一个四元数。返回生成的四元数。


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

axis1,angle1,axis2,angle2,axis3, 和angle3 创建一个四元数。返回生成的四元数。


quaternion fromAxisAndAngle(vector3d axis, real angle)

axisangle 创建一个四元数。返回得到的四元数。


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

x,y,z, 和angle 创建一个四元数。返回生成的四元数。


quaternion fromEulerAngles(vector3d eulerAngles)

eulerAngles 创建一个四元数。返回得到的四元数。


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

pitch,yaw, 和roll 创建一个四元数。返回生成的四元数。


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

axisangle 创建一个相对于本地原点围绕point 的旋转矩阵。返回生成的矩阵 4x4。


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