本页内容

Transform QML Type

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

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

Component3D

Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

方法

详细说明

Transform组件无法在多个Entity之间共享。变换由3D向量缩放、四元数旋转和3D向量平移三个组件构成。这些变换将按此顺序应用于网格。当设置Transform::matrix 属性时,该属性会被分解为这些变换组件,并发出相应的变换信号。

提供了若干辅助函数用于配置 Transform;fromAxisAndAngle 和fromAxesAndAngles 可用于设置围绕特定轴的旋转,fromEulerAngles 可用于基于欧拉角设置旋转,rotateAround 可用于围绕相对于本地原点的特定点旋转对象。

属性文档

matrix : matrix4x4

存储变换的 4×4 矩阵。

注意:当 设置矩阵属性时 ,该矩阵会被分解为平移、旋转和缩放分量。

rotation : quaternion

将变换的旋转作为四元数保存。

rotationX : real

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

rotationY : real

将变换的 y 轴旋转以欧拉角的形式存储。

rotationZ : real

将变换的z轴旋转作为欧拉角保存。

scale : real

保存变换的统一缩放比例。如果缩放比例是通过scale3D 设置的,则仅保存x值。

scale3D : vector3d

将变换的缩放因子存储为 Vector3d 类型。

translation : vector3d

将变换的平移值作为 vector3d 存储。

方法文档

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)

根据axis 和angle 生成一个四元数。返回生成的四元数。

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)

根据axis 和angle ,围绕point (相对于局部原点)创建一个旋转矩阵。返回生成的4x4矩阵。

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