Qt Quick 3D 提供用于创建 3D 内容和 3D 用户界面的高级 API,基于 Qt Quick . Rather than using an external engine, which creates syncing issues and additional layers of abstraction, Qt Quick 3D provides extensions to the existing Qt Quick 场景图形 for spatial content and a renderer for that extended scene graph. When using the spatial scene graph, it's possible to mix Qt Quick 2D content with 3D content.
The QML types of the module are available through the
QtQuick3D
导入。要使用类型,添加以下 import 语句到 .qml 文件:
import QtQuick3D
The following module imports provide additional functionality:
import QtQuick3D.AssetUtils import QtQuick3D.Helpers import QtQuick3D.Particles3D
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .
使用
find_package()
command to locate the needed module component in the
Qt6
包:
find_package(Qt6 REQUIRED COMPONENTS Quick3D)
target_link_libraries(mytarget PRIVATE Qt6::Quick3D)
更多细节,见 构建采用 CMake 概述。
To configure the module for building with qmake, add the module as a value of the
QT
variable in the project's .pro file:
QT += quick3d
When building from source, ensure that the modules and tools from the qtdeclarative and qtshadertools repositories are built first, as it's not possible to use Qt Quick 3D without these. Having qtquicktimeline available is strongly recommended as well, since keyframe-based animations will not be available otherwise.
In addition, some of the examples rely on Qt Quick Controls .
Changes to Qt Quick 3D lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.
Qt Quick 3D 在商业许可下是可用的来自 Qt 公司 。此外,它是可用的根据 GNU GPL (一般公共许可) 第 3 版 。见 Qt 许可 进一步了解细节。
Furthermore, Qt Quick 3D potentially contains third party modules under the following permissive licenses:
| Godot Engine: Fog | MIT 许可 |
| Intel Embree, version 3.13.3 | Apache 许可 2.0 |
| Open Asset Import Library, version 5.2.5 | BSD 3 条款新 (或修订) 许可 |
| ProceduralSky | MIT 许可 |
| Tiny OpenEXR, version v1.0.2 | BSD 3 条款新 (或修订) 许可 |
| meshoptimizer, version v0.18 | MIT 许可 |
| xatlas, version 16ace528acd2cf1f16a7c0dde99c42c486488dbe | MIT 许可 |