qt3d

How to render in Qt3D in standard GUI application?

社会主义新天地 提交于 2019-11-30 02:05:33
I enjoy using Qt3D, but all of the examples I see for it are full window applications. What I can't understand from the examples is how to add a qt3d rendering window to a regular qt gui application. Basically what I want is a little rendering widget for my Qt5 Gui application. I've looked into Qtgl widget, but I really want to use the scene management abilities of Qt3D. How can I render as a sub window inside of a qt Gui window? Is this possible? Update So I added this to my MainWindow.cpp It is loosely based off of this http://blog.qt.digia.com/blog/2013/02/19/introducing

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

不羁岁月 提交于 2019-11-30 01:47:06
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 example Qt material documentation Qt MyCylinder example Stackoverflow question and answer about using

Qt - How to get mouse events on Qt3DWindow

穿精又带淫゛_ 提交于 2019-11-29 16:45:11
I want to get mouse events (like mouse position) on a Qt3D Window, every time I click inside the window. I've seen this question ( also the same question on this forum ) but my Qt3DWindow is not inside any widget, so I don't think I need an EventFilter. I'm just beggining to learn C++ and Qt, so I'm trying to make the simplest program possible. In the code below (all my program is in this code), I would like to get the mouse position every time I click inside the Qt3D Window, but I can't even get a debug message every time I click. As far as I understand, the mouseMoveEvent function is only

How to render in Qt3D in standard GUI application?

微笑、不失礼 提交于 2019-11-28 23:00:15
问题 I enjoy using Qt3D, but all of the examples I see for it are full window applications. What I can't understand from the examples is how to add a qt3d rendering window to a regular qt gui application. Basically what I want is a little rendering widget for my Qt5 Gui application. I've looked into Qtgl widget, but I really want to use the scene management abilities of Qt3D. How can I render as a sub window inside of a qt Gui window? Is this possible? Update So I added this to my MainWindow.cpp

Qt3d. Draw transparent QSphereMesh over triangles

大兔子大兔子 提交于 2019-11-28 13:58:27
I have a function that draws triangles through OpenGL I draw two triangles by pressing a button (function on_drawMapPushButton_clicked()). Then i draw a sphere that placed above these triangles. And now i see, that sphere is drawed correctly over first triangle, but second triangle drawed over the sphere and not vice versa. If i press the button second time, then spehere is drawed correctly over first and second triangles. When i press the button third time, then second triangle drawed over the sphere again. When i press the button fourth time, then spehere is drawed correctly over first and

Qt - How to get mouse events on Qt3DWindow

末鹿安然 提交于 2019-11-28 11:30:48
问题 I want to get mouse events (like mouse position) on a Qt3D Window, every time I click inside the window. I've seen this question (also the same question on this forum) but my Qt3DWindow is not inside any widget, so I don't think I need an EventFilter. I'm just beggining to learn C++ and Qt, so I'm trying to make the simplest program possible. In the code below (all my program is in this code), I would like to get the mouse position every time I click inside the Qt3D Window, but I can't even

How to make color of a section be different on a 3D object

雨燕双飞 提交于 2019-11-28 10:36:51
问题 I have the following 3D object: The material of my 3D object is coded like this with Qt3D: void MyClass::addMaterial(Qt3DCore::QEntity *entity) { Qt3DExtras::QPhongMaterial * material = new Qt3DExtras::QPhongMaterial(); material->setAmbient(QColor(245-30, 245-15, 245)); material->setDiffuse(QColor(125-30, 125-15, 125)); material->setSpecular(QColor(215-30, 255-15, 255)); entity->addComponent(material); } The above code gives the same colors to 3D object entity uniformly . How can I give

Qt3d. Draw transparent QSphereMesh over triangles

独自空忆成欢 提交于 2019-11-27 04:48:01
问题 I have a function that draws triangles through OpenGL I draw two triangles by pressing a button (function on_drawMapPushButton_clicked()). Then i draw a sphere that placed above these triangles. And now i see, that sphere is drawed correctly over first triangle, but second triangle drawed over the sphere and not vice versa. If i press the button second time, then spehere is drawed correctly over first and second triangles. When i press the button third time, then second triangle drawed over