qt3d

Set CullFace to Front and Back in Qt3D in Python via PySide2

梦想与她 提交于 2021-02-20 05:13:37
问题 I wanted to set QCullFace to FrontAndBack and that is why I wrote this: from PySide2.Qt3DRender import Qt3DRender cull_face = Qt3DRender.QCullFace() cull_face.setMode(Qt3DRender.QCullFace.FrontAndBack) render_pass = Qt3DRender.QRenderPass() render_pass.addRenderState(cull_face) The code above should set CullFace globally. But it does not. What did I do wrong? 回答1: I assume that the python binding does not change how Qt works in C++. So you probably have a Qt3DWindow somewhere (unless you

Set CullFace to Front and Back in Qt3D in Python via PySide2

风流意气都作罢 提交于 2021-02-20 05:13:07
问题 I wanted to set QCullFace to FrontAndBack and that is why I wrote this: from PySide2.Qt3DRender import Qt3DRender cull_face = Qt3DRender.QCullFace() cull_face.setMode(Qt3DRender.QCullFace.FrontAndBack) render_pass = Qt3DRender.QRenderPass() render_pass.addRenderState(cull_face) The code above should set CullFace globally. But it does not. What did I do wrong? 回答1: I assume that the python binding does not change how Qt works in C++. So you probably have a Qt3DWindow somewhere (unless you

How to put QPushButton into Qt3DWindow which is in the widget?

て烟熏妆下的殇ゞ 提交于 2021-01-28 04:03:43
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

How to put QPushButton into Qt3DWindow which is in the widget?

霸气de小男生 提交于 2021-01-28 02:41:05
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

How to put QPushButton into Qt3DWindow which is in the widget?

南笙酒味 提交于 2021-01-27 22:43:00
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

Qt3D: How to scale a Scene2D to be the same size as the window (pixel-wise)?

天涯浪子 提交于 2020-12-13 03:10:55
问题 I created a C++ application with a 800x600 window that successfully draws a few objects in QML using Qt Quick 2 elements as well as Qt 3D objects: The QML code draws a couple of green/yellow rectangles using Qt Quick 2 Rectangle elements inside a Scene2D . Then the 2D scene is blitted to one of the surfaces of a 3D cube for rendering and be displayed within the 3D world. Finally, a blue SphereMesh from Qt 3D is rendered at the center as the screenshot above demonstrates. I've been trying to