IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt 3D

Qt 3D Reference Documentation.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt 3D▲

Qt 3D provides functionality for near-realtime simulation systems with support for 2D and 3D rendering in both Qt C++ and Qt Quick applications.

The functionality in Qt 3D is divided into the following C++ modules:

  • https://: The Qt 3D module contains functionality to support near-realtime simulation systems.

  • https://: The Qt 3D Input module provides classes for handling user input in applications using Qt3D.

  • https://: The Qt 3D Logic module enables synchronizing frames with the Qt 3D backend.

  • https://: The Qt 3D Render module contains functionality to support 2D and 3D rendering using Qt 3D.

The following C++ modules are in still development but are available as technology previews:

  • https://: The Qt 3D Animation modules provides a set of prebuilt elements to help you get started with Qt 3D.

  • https://: The Qt 3D Extras module provides a set of prebuilt elements to help you get started with Qt 3D.

  • https://: The Qt 3D Scene2D module provides a way to render Quick2 qml content to a Qt 3D texture.

For Qt Quick applications, Qt 3D provides the following QML modules:

  • https://: Provides core Qt 3D QML types.

  • https://: Provides QML types for Qt 3D user input.

  • https://: Provides QML types to synchronize frames with the 3D backend.

  • https://: Provides Qt 3D QML types for rendering.

The following QML modules are in still development but are available as technology previews:

  • https://: Provides Qt 3D QML types for the extras module.

  • https://: Provides Qt 3D QML types for the animation module.

  • https://: Provides Qt 3D QML types for the scene2d module.

  • https://: Provides Qt 3D QML types for the Scene3D module.

Using the Module▲

For a C++ application that performs 2D or 3D rendering, collision detection, and handles user input, include the following directives of the modules' classes:

 
Sélectionnez
#include <Qt3DCore>
#include <Qt3DRender>
#include <Qt3DInput>
#include <Qt3DLogic>
#include <Qt3DExtras>
#include <Qt3DAnimation>

To import the QML types into your application, use the following import statement in your .qml file:

 
Sélectionnez
import Qt3D.Core
import Qt3D.Render
import Qt3D.Input
import Qt3D.Logic
import Qt3D.Extras
import Qt3D.Animation
import QtQuick.Scene2D
import QtQuick.Scene3D

Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including http:// and qmake.

Building with CMake▲

Use the find_package() command to locate the needed module components in the Qt6 package:

 
Sélectionnez
find_package(Qt6 REQUIRED COMPONENTS
    3DCore
    3DRender
    3DInput
    3DLogic
    3DExtras
    3DAnimation
)
target_link_libraries(mytarget PRIVATE
    Qt6::3DCore
    Qt6::3DRender
    Qt6::3DLogic
    Qt6::3DExtras
    Qt6::3DAnimation
)

Building with qmake▲

To configure the module for building with qmake, add the modules to the QT variable in the project's .pro file:

 
Sélectionnez
QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation

A Qt Quick application requires additional dependencies:

 
Sélectionnez
QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation qml quick 3dquick

Overview▲

The high level design and motivation for Qt 3D is described in the https://. The Qt 3D Render offers support for data-driven configuration as described in https://.

Reference▲

  • https://

  • https://

  • https://

  • https://

Qt 3D Platform Support▲

Qt 3D has the following support for platforms:

  • Microsoft Windows (win32) - Supported

  • Linux X11 - Supported

  • macOS - Supported although there may be some retina scaling issues

  • Android - Supported

  • Embedded Linux - Supported

  • iOS - Supported since (Qt 5.7)

  • WinRT - Not supported yet

Module Evolution▲

https:// lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.

Licenses and Attributions▲

Qt 3D is available under commercial licenses from http://. In addition, it is available under the GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.

Furthermore Qt 3D contains third party modules under following permissive licenses:

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.