qt3d

Qt3D geometry shader working in QML but not in C++

混江龙づ霸主 提交于 2020-08-20 06:11:07
问题 Update The OpenGL version seems to be 4.3 at least according to the following code QSurfaceFormat format = view.format(); int major = format.majorVersion(); int minor = format.minorVersion(); so geometry shaders should work and the issue seems to be something else. Original Question While trying to answer this question related to how to create billboards in Qt3D I encountered an issue I found no solution for. I used the code from this GitHub repository which contains C++ and QML. It works

Qt3d transparency texture will be covered. How to slove that?

旧街凉风 提交于 2020-08-10 19:24:57
问题 I add a plane to the 3D world and it should be in torus's center. But if I add the plane first and the tour second, the plane will be tour covered (plane's coordinate is in tour center): I think it is about paint order. The plane should be drawn in last order. Changing plane and torus adding order will be correct: Can QDepthTest help me? Or any other way? Can show me some examples? Thanks! code (without the sphere): class FlippedTextureImage : public Qt3DRender::QPaintedTextureImage { public:

Qt3d transparency texture will be covered. How to slove that?

本小妞迷上赌 提交于 2020-08-10 19:22:27
问题 I add a plane to the 3D world and it should be in torus's center. But if I add the plane first and the tour second, the plane will be tour covered (plane's coordinate is in tour center): I think it is about paint order. The plane should be drawn in last order. Changing plane and torus adding order will be correct: Can QDepthTest help me? Or any other way? Can show me some examples? Thanks! code (without the sphere): class FlippedTextureImage : public Qt3DRender::QPaintedTextureImage { public:

QML load and display .ply mesh with color attributes

萝らか妹 提交于 2020-08-10 05:00:07
问题 I am trying to load a simple cube with per-vertex color information from a Stanford PLY file using QML. My entity looks like this: Entity { id: circle property Material materialPoint: Material { effect: Effect { techniques: Technique { renderPasses: RenderPass { shaderProgram: ShaderProgram { vertexShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.vert") fragmentShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.frag") } } } } parameters:

How do I draw a simple line in Qt3D?

亡梦爱人 提交于 2020-06-24 13:48:59
问题 I feel like this should be pretty straightforward, but for my life I can't figure out how to draw a basic line using Qt 3D. The only guidance I've been able to find on the subject is this obscure video, in which there's an off-putting amount of raw byte buffer and memory manipulation going on via scarcely documented classes. Is there a better way to do this using the shiny new API that I'm missing? 回答1: From the video you linked, I came up with the code below (also posted in Qt forums: https:

Importing objects in Qt3D doesn't work but there's not error message

南楼画角 提交于 2020-01-30 09:21:25
问题 I have a Qt3D application which imports STL file formats: m_sceneLoaderEntity = new Qt3DCore::QEntity(); m_sceneLoaderEntity->setObjectName("New imported entity"); Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(m_sceneLoaderEntity); sceneLoader->setSource(fileUrl); // fileUrl is input m_sceneLoaderEntity->addComponent(sceneLoader); My application builds and runs without any problem with Qt 5.9.0, 5.9.1, 5.9.2, 5.9.3 and 5.9.4. So far so good. My application build fine