qt3d

How to apply transformations to mesh geometry

你离开我真会死。 提交于 2019-12-24 00:23:15
问题 On Qt3D, an entity can have these two components: Qt3DRender::QGeometryRenderer component which contains the mesh geometry data like vertex positions and normals . Qt3DCore::QTransform component which contains the rotations , translations and scalings . I intend to export the mesh data as STL with all the transformations applied to mesh geometry . I mean, all rotations and translations need to be applied to vertex positions... When I access the mesh geometry data, like below, the

Detecting touch on 3D objects, in addition to mouse click

女生的网名这么多〃 提交于 2019-12-23 17:07:39
问题 How to use Qt3DRender::QObjectPicker with touch events? I'm adding Qt3DRender::QObjectPicker component to my Qt3D entities by this method: Qt3DRender::QObjectPicker *MyClass::createObjectPickerForEntity(Qt3DCore::QEntity *entity) { Qt3DRender::QObjectPicker *picker = new Qt3DRender::QObjectPicker(entity); picker->setHoverEnabled(false); entity->addComponent(picker); connect(picker, &Qt3DRender::QObjectPicker::pressed, this, &MyClass::handlePickerPress); return picker; } My object picker works

Qt3D: How to render a mesh in wireframe mode using Qt C++

邮差的信 提交于 2019-12-18 11:04:52
问题 Qt3D documentation is increasing but still lacking some information especially on how to do things without Qml/QtQuick. After heavily searching the web about rendering a mesh in wireframe mode I found a lot of helpful hints and examples that all together resulted in an example viewer that I wanted to present here as a contribution to all the guys that wrote the articles and others who may have searched similar examples. The most helpful links were these: Qt basic shapes example Qt wireframe

Qt: 3D Horizontal Bar Chart

荒凉一梦 提交于 2019-12-12 21:13:33
问题 I am trying to draw a 3D horizontal bar chart using Qt 3D.I am trying to achieve this by drawing consecutive cuboids having the same x , y and rotation and translating them to different depths.But it seemed that changing the depth only is not working as both x and y are also changing and I can't figure it out. Update: I found out that the x and y attributes should also be changed by specific values. I hard-coded it and it works fine but I can't figure out an equation to do this automatic with

Understanding the mesh created by Qt3D

蓝咒 提交于 2019-12-12 13:40:42
问题 I create a Qt3D mesh like this: Qt3DCore::QEntity *newEntity = new Qt3DCore::QEntity(); Qt3DExtras::QConeMesh *mesh =new Qt3DExtras::QConeMesh(); mesh->setTopRadius(0.2); mesh->setBottomRadius(1.0); mesh->setLength(2.0); for(int i = 0; i < mesh->geometry()->attributes().size(); ++i) { mesh->geometry()->attributes().at(i)->buffer()->setSyncData(true); // To have access to data } newEntity->addComponent(mesh); The created mesh looks like this: Later in the code, I try to export the above mesh

Qt3D rotate camera around mesh

喜你入骨 提交于 2019-12-12 12:25:17
问题 I've recently started learning Qt/QML/C++ and trying to build a very basic 3D scene to rotate the camera around a mesh object. I'm finding it very difficult to follow the examples and I'm finding the documentation doesn't provide any useful instructions. There doesn't seem to be many tutorials out there either, perhaps I'm looking in the wrong places. main.cpp #include <Qt3DQuickExtras/qt3dquickwindow.h> #include <Qt3DQuick/QQmlAspectEngine> #include <QGuiApplication> #include <QtQml> int

Unknown module(s) in Qt

女生的网名这么多〃 提交于 2019-12-12 01:37:29
问题 Unknown module(s) in Qt: 3-d. As I know, Qt(5.6) already have 3-D library, why still appear this reminder when I use it in Qt? Thanks very much. 回答1: Because 3-d isn't a Qt module, the correct modules are listed on the Qt3D page though: Qt3D Docs. They are: QT += 3dcore 3drender 3dinput 3dlogic 来源: https://stackoverflow.com/questions/36125777/unknown-modules-in-qt

QSphereMesh in Qt 3D: how can I correctly add a texture on it?

青春壹個敷衍的年華 提交于 2019-12-11 06:05:53
问题 I want to draw a semi-transparent textured sphere in Qt 3D (to plot some kind of colormap on it). I'm trying to draw a sphere and add a texture. The texture fits good on some regions of the sphere, but on the poligons near its poles it becomes sizzled. Can you tell me, what's my mistake? Here's my code that tries to draw a sphere: #include <QApplication> #include <Qt3DExtras/Qt3DWindow> #include <Qt3DCore/QEntity> #include <Qt3DExtras/QSphereMesh> #include <Qt3DExtras/QTextureMaterial>

QML apply a texture to a Mesh

筅森魡賤 提交于 2019-12-11 04:42:08
问题 I am trying to apply an image texture to a Mesh in QML (Qt 5.6.2). I started from the sample "Shadow Map QML" and I want to texture the GroundPlane. Material and Effect qml classes are applied to that GroundPlane mesh but I can't see how to apply an image texture. In QML, there is TextureImage, ShaderEffect but nothing about how they can be applied to a Mesh. Any ideas? EDIT: Qt 5.6.2 is not the good version to work with to use Qt3D as the first "fully supported release of a stable Qt 3D

FbxGeometryLoader with QML

房东的猫 提交于 2019-12-11 00:29:37
问题 I want to import a .fbx file into my Scene3D, via the QMesh type, all in QML. Per the documentation, QMesh will also support the following format if the SDK is installed and the fbx geometry loader plugin is built and found So the result I want is something like the following: Entity { ... Mesh{ source: "qrc:/3dmodels/potato.fbx" } } After some searching, I found this post on the Qt forum, which directed me to download and include the Autodesk SDK into my project (via CMake). I think that the