Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qt3d
    Log in to post

    • UNSOLVED Building Qt3D 6.0.0
      Qt 6 • qt3d build qt6 • • Jakob Weiss  

      8
      2
      Votes
      8
      Posts
      272
      Views

      thanks for trying to shed some light on this. As I said, I have already installed the vulkan SDK (the "official" one from LunarG as I am trying to build for windows). I have even added the include directory directly in the *.pro file, and have observed that when opening the qt3d project with QtCreator, it can correctly resolve the vulkan libraries, so I think this is not the problem. I will try your suggestion of putting the vulkan headers directly in the qt directory and see if that gets me anywhere..
    • SOLVED Dynamic Textures in Qt3D with C++
      Game Development • opengl qt3d graphics qt5.15.0 • • Jakob Weiss  

      2
      0
      Votes
      2
      Posts
      76
      Views

      Ok, I figured out how to use updateData properly. Leaving this here for posterity. For my use case, I needed to upload a grayscale 3D texture but this should be the same for any texture type: using namespace Qt3DRender; QTexture * tex = new QTexture3D; tex->setSize(vol.width(), vol.height(), vol.depth()); tex->setFormat(QTexture3D::TextureFormat::R8_UNorm); tex->setLayers(1); tex->setGenerateMipMaps(false); QTextureWrapMode wm(QTextureWrapMode::ClampToBorder); tex->setWrapMode(wm); data->setFormat(QOpenGLTexture::TextureFormat::R8_UNorm); data->setWidth(vol.width()); data->setHeight(vol.height()); data->setDepth(vol.depth()); data->setMipLevels(1); data->setLayers(1); data->setPixelFormat(QOpenGLTexture::PixelFormat::Red); data->setPixelType(QOpenGLTexture::PixelType::UInt8); QByteArray qba; qba.setRawData((const char *)vol.dataUint8(), static_cast<int>(vol.byteSize())); data->setData(qba, 1); QTextureDataUpdate update; update.setX(0); update.setY(0); update.setData(data); tex->updateData(update); Qt3DRender::QParameter p(); p.setName("volume"); // the uniform name in the shader p.setValue(QVariant::fromValue(tex)); QMaterial * mat = ...; // queried from the qml mat->addParameter(p); The Qt3D test for texture update was pretty helpful in figuring this out.
    • UNSOLVED Can't use custom GLTF models in 5.15.1
      General and Desktop • qt3d gltf qt3d skeletonloader • • Dmitry87  

      2
      0
      Votes
      2
      Posts
      42
      Views

      I have a similar problem. I get the following error message when loading a gltf file with the QML SkeletonLoader: [Qt][Qt3D.Renderer.Jobs][2] :0 :: Unknown buffer 0 when processing buffer view Neither self-exported files from Blender nor files downloaded from the gltf git (glTF-Sample-Models) are working. So I also need to know how to correctly export gltf or whether further adjustments in Qt are necessary in order to make it work.
    • UNSOLVED Problem with macdeplayqt and Qt3D
      QML and Qt Quick • qml qtquick qt3d macdeployqt renderer • • shav  

      7
      0
      Votes
      7
      Posts
      57
      Views

      Or you can fix the macdeployqt code and build it to replace your version. That way you benefit from all the file processing done during the deployment process.
    • UNSOLVED Qt3D Manual MipMap generation
      General and Desktop • qt3d mipmap • • MikkelL  

      1
      0
      Votes
      1
      Posts
      29
      Views

      No one has replied

    • UNSOLVED Qt3D: Problem with UV texture mapping.
      General and Desktop • qt3d render uv texture • • shav  

      1
      0
      Votes
      1
      Posts
      40
      Views

      No one has replied

    • UNSOLVED How to set Model:geometry from C++?
      QML and Qt Quick • qt3d • • Tom asso  

      1
      0
      Votes
      1
      Posts
      44
      Views

      No one has replied

    • UNSOLVED Unable to take screenshot of Qt3D window with transparent background on Mac
      General and Desktop • qt3d qt3dwindow qt3drender qforwardrender defaultframegra • • poortipant  

      2
      0
      Votes
      2
      Posts
      79
      Views

      Hi, I can't answer to that directly. Can you provide a minimal compilable example that shows that behaviour ?
    • UNSOLVED Render QGraphicsView into video file problem
      General and Desktop • qt3d qtimer qgraphics • • hamed_ta  

      2
      0
      Votes
      2
      Posts
      72
      Views

      opencv (extra characters to make response longer than 8 characters...lame!)
    • UNSOLVED Add Entity to Scene3D Dynamically
      QML and Qt Quick • qt3d dynamic scene3d • • qtMec  

      1
      0
      Votes
      1
      Posts
      211
      Views

      No one has replied

    • SOLVED Integration fo Qt3D C++ back-end with QML front-end?
      QML and Qt Quick • qml c++ qt3d qt 5.14 • • Alain38 0  

      2
      0
      Votes
      2
      Posts
      78
      Views

      OK, Finally we found the solution. The tip is to create a Scene3D in the qml file. And to create the camera and ForwaqrdRenderer in the QML too (and not in the C++). Scene3D { id: scene3D anchors.fill: parent anchors.margins: 10 focus: true Root3DEntity { id : root3DEntity renderSettings : RenderSettings { id : renderSettings pickingSettings.pickMethod : pickingSettings.PrimitivePicking activeFrameGraph: ForwardRenderer { id: renderer clearColor: "#4d4d4f" camera: Camera { id: camera projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 nearPlane: 0.1 farPlane: 1000.0 position: Qt.vector3d(0.0, 0.0, 2.0) upVector: Qt.vector3d(0.0, 1.0, 0.0) viewCenter: Qt.vector3d(0.0, 0.0, 0.0) } } } } }
    • SOLVED Depth problem with Qt3D
      General and Desktop • qt3d qt5.12.x depth test • • Alain38 0  

      4
      0
      Votes
      4
      Posts
      168
      Views

      Correction. I do not why. But my proposal no more works. But I found another way that seems to work. In fact the QDiffuseSpecularMaterial that we are supposed to use (other materials are deprecated), disable the depth buffer. So, this is a working code to force the enable (create a new effect does not work): Qt3DRender::QEffect *effect = material->effect(); if (effect) { for (Qt3DRender::QTechnique* currentTechnique : effect->techniques()) { for (Qt3DRender::QRenderPass * currentPass : currentTechnique->renderPasses()) { for (Qt3DRender::QRenderState * currentState : currentPass->renderStates()) { if (dynamic_cast<Qt3DRender::QNoDepthMask *>(currentState)) { currentPass->removeRenderState(currentState); Qt3DRender::QDepthTest* depthTest = new Qt3DRender::QDepthTest; depthTest ->setDepthFunction(Qt3DRender::QDepthTest::Less); currentPass->addRenderState(depthTest); break; } } } } } Warning: if you have fully transparent (alpha = 0) objects, the test fails. So the objects behind the invisible one are not displayed.
    • UNSOLVED QText2DEntity disappears when I change the text.
      General and Desktop • qt3d qt5.12.x qtext2dentity • • Alain38 0  

      2
      0
      Votes
      2
      Posts
      98
      Views

      @Alain38-0 OK. Now I have found a way to always have a displayed text. For this, in the initial setText (when scene is not yet rendered) I'm putting all the characters that can appear in the strings that will be displayed. Then, I have something displayed. But it is often wrong. To be more explicit I'm doing this: void createScene() { ... myTextEntity->setText("?CLRT0123456789"); ... } void pageDisplayed() { ... myTextEntity->setText("???"); ... } void onButtonCLicked() { myTextEntity->setText("C23"); } setText("C23") displays another string of three characters (like "2R7"). But, at least strings have a coherency (all 'L' are replaced by '0', and so on).
    • UNSOLVED Video inside Qt 3d window ?
      General and Desktop • qt3d video rendering • • asimfile  

      1
      0
      Votes
      1
      Posts
      49
      Views

      No one has replied

    • UNSOLVED QSurface3DSeries set vertical texture
      General and Desktop • qt3d texture surface • • StraNet  

      1
      0
      Votes
      1
      Posts
      109
      Views

      No one has replied

    • UNSOLVED How to get vertices, normals and indeces from Qt3DRender::QAttribute buffer of Qt3DRender::QGeometry
      General and Desktop • opengl qt3d • • JulianM  

      2
      0
      Votes
      2
      Posts
      388
      Views

      @julianm You will have to set setSyncData(true); on the attribute-buffers and also synch the index buffers to get the right vertices.
    • UNSOLVED Wrapping Texture on CuboidMesh
      General and Desktop • qt3d • • Zee_07  

      1
      0
      Votes
      1
      Posts
      138
      Views

      No one has replied

    • SOLVED C++ Qt3DExtras::QTorusMesh – cannot be rotated in Z direction
      General and Desktop • qt3d • • JulianM  

      6
      0
      Votes
      6
      Posts
      437
      Views

      Ok I found what is causing that - the torus is created facing Z. Thanks.
    • UNSOLVED Future cross-platform viability of Qt 3D?
      Game Development • qt3d macos vulkan metal • • GerryH  

      5
      0
      Votes
      5
      Posts
      841
      Views

      Great question, @GerryH! My impression is that the automotive industry is one of biggest customers for the Qt Company (TQtC) at the moment. 3D graphics and Qt Quick are vital to the automotive IVIs, so TQtC and their partners (like KDAB, a major contributor to Qt 3D) will continue to pour lots of resources into them. In general, I believe that any effort you invest into Qt Quick and Qt 3D is quite safe for the next 5-10 years. The path forward isn't easy -- Vulkan, Metal, and DirectX 12 support are all far far behind the level of OpenGL support, so it will be years before they catch up. Nonetheless, my gut feeling tells me that dropping support for Apple is unthinkable, so TQtC will adapt to Apple's demands. And given Apple's history of viciously dropping backwards compatibility, the sense of urgency is definitely there. Some possible ways forward are: Use MoltenGL to keep the OpenGL backend usable on Apple platforms (TQtC either forms a direct partnership with Molten, or Qt customers buy MoltenGL themselves), OR Add abstraction layers to decouple Qt from OpenGL and add a Metal backend directly, OR Like #2 but provide a Vulkan backend for Qt 3D and Qt Quick, and then use MoltenVK to support Apple platforms (like how OpenGL + ANGLE is currently used to support Windows) Personally, I think #3 makes most sense because Vulkan support directly benefits Qt on all platforms, not just Apple platforms. However, I can't tell if this is a feasible business strategy for TQtC or not, or what kind of tradeoffs exist compared to a direct Metal backend. But anyway, for a more reliable source, this recent email from a TQtC employee suggests that they are currently planning the direct-Metal route: https://lists.qt-project.org/pipermail/interest/2018-December/063503.html There should be a more formal announcement sometime this year. (Disclaimer: I, too, am a mere community member who lacks a crystal ball)
    • SOLVED QGeometryRenderer: How to render an isosurface from quadrilateral patches?
      General and Desktop • qt3d qt3drender • • Finn  

      3
      0
      Votes
      3
      Posts
      470
      Views

      I found a solution. Please see my stackoverflow post.
    • UNSOLVED Qt3d: Height map rendering
      Game Development • qt3d material heightmap displacement • • LukasT  

      2
      0
      Votes
      2
      Posts
      702
      Views

      I saw terrain rendering in this old video, but I couldn't find the code to it: https://www.youtube.com/watch?v=bYgSxoXgSU8 Maybe you have more luck.
    • SOLVED QObjectPicker - QPickingSettings::TrianglePicking doesn't work with custom mesh
      General and Desktop • qt3d picking custom geometry • • JulianM  

      2
      0
      Votes
      2
      Posts
      287
      Views

      Never mind the problem was in my code - /I was not counting correctly the vertices :-)/ Everything works as expected .
    • SOLVED How to print text with QText2DEntity?
      Game Development • c++ qt3d qt5.9 qt 5.9 qtext2dentity • • PolyGlot  

      4
      1
      Votes
      4
      Posts
      905
      Views

      @Cute3d, yes, it finally works. Idk what was wrong. Example project:https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example And due to god-knows-what reasons it doesn't work in debug mode. Hope, that project can help someone.
    • UNSOLVED Qt3d Preview no longer launching
      General and Desktop • qt3d debug preview • • Eric Sterner  

      3
      0
      Votes
      3
      Posts
      393
      Views

      OK, seems like shadow casting on the default light might be broken. Turning it on caused the scene to crash.
    • SOLVED Qt3D: Create mirrored object
      General and Desktop • qml qt3d • • Jan80  

      2
      0
      Votes
      2
      Posts
      437
      Views

      Ok, solution 2 was simpler than i expected. I'll post my code below, in case someone else needs something similar. It flips a QEntity along the x-axis and the winding of the triangles. It only works with the primitive type QGeometryRenderer.Triangles. Jan void mirrorEntity(Qt3DCore::QEntity *entity) { for (QNode* node: entity->childNodes()) { if (QEntity* e = dynamic_cast<QEntity*>(node)) mirrorEntity(e); if (QGeometryRenderer* r = dynamic_cast<QGeometryRenderer*>(node)) mirrorGeometryRenderer(r); } } void mirrorGeometryRenderer(QGeometryRenderer *geometryRenderer) { QGeometry* geometry = geometryRenderer->geometry(); for (QAttribute* a : geometry->attributes()) { if (a->name() == QAttribute::defaultPositionAttributeName()) { QByteArray data = a->buffer()->data(); // flip along x-axis float *bufferContent = reinterpret_cast<float*>(data.data()); int chunkSize = a->byteStride()/sizeof(float); int positionOffset = a->byteOffset(); for (uint i=0; i<a->count()*chunkSize; i+=chunkSize) { int offsetI = i + positionOffset; bufferContent[offsetI] = -bufferContent[offsetI]; // invert x } // change winding const int size = a->byteStride(); char* tmp = new char[size]; for (int i=0; i<data.length(); i+=a->byteStride()*3) { memcpy(tmp, &data.data()[i+size], size); memcpy(&data.data()[i+size], &data.data()[i+size*2], size); memcpy(&data.data()[i+size*2], tmp, size); } delete[] tmp; a->buffer()->setData(data); break; } } }
    • UNSOLVED Using ObjectPicker on imported mesh not working
      General and Desktop • qt3d scene3d • • zoeetc  

      1
      0
      Votes
      1
      Posts
      229
      Views

      No one has replied

    • SOLVED Qt3D: how to print text? (QText2DEntity)
      Game Development • c++ qt3d text qt3d 2.0 qtext2dentity • • zespy  

      7
      0
      Votes
      7
      Posts
      3420
      Views

      I've got the same issue with Qt3DExtras::QText2DEntity. But I found the workaround. Look like there is a bug? in implementation of Qt3DExtras::QText2DEntity that prevents internal initialization (QText2DEntityPrivate::setScene is never called). This happens when scene is already visible and Qt3DExtras::QText2DEntity is created with parent entity passed to constructor. The workaround I used to make it work is to pass nullptr (which is default) as parent in constructor and call ->setParent(parentEntity) in separate call. m_text2dLabel = new Qt3DExtras::QText2DEntity(); m_text2dLabel->setParent(parentNode);
    • UNSOLVED Get size of entity in QT3D
      General and Desktop • qt3d qt3d qml scene3 • • zoeetc  

      2
      1
      Votes
      2
      Posts
      648
      Views

      There has been a question here already: https://forum.qt.io/topic/85533/qt3d-qml-geometry-bounding-box. But I couldn't really find any code in the github repository. What I'd suggest is you get the QGeometryRenderer from the text entity. The geometry renderer has a QGeomemtry attribute, which in turn has a set of QAttributes. There must be an attribute with a name like "vertexPosition". You need to get the QBuffer from the attribute and retrieve the vertices starting at position byteOffset (that is an attribute of QAttribute). The next vertexSize (also an attribute of QAttribute) entries should belong to the vertex position. Then continute at position byteOffset + i * byteStride, while i being the index you're reading right now. Do this for count (also an attribute) times. This way you can get all vertex positions and calculate a bounding box based on them.
    • UNSOLVED How can I load a 3D model with shader into a Qt3D Scene
      General and Desktop • qml qt3d scene3d blender • • Aras  

      1
      0
      Votes
      1
      Posts
      366
      Views

      No one has replied

    • UNSOLVED Qt3D Animation C++
      General and Desktop • c++ qt3d c++ qt animation 3d model • • Lukadriel  

      7
      0
      Votes
      7
      Posts
      1779
      Views

      @Lukadriel Hi, One year passed and still waiting for the proper example. Did they give any tips?
    • UNSOLVED Qt3d QML representing dynamically growing number of obstacles
      QML and Qt Quick • qml qt3d qt5.9 dynamic qml • • MatPaul  

      1
      0
      Votes
      1
      Posts
      319
      Views

      No one has replied

    • SOLVED Qt3D/QML Geometry Bounding Box
      Game Development • qml qt3d geometry • • Tom_H  

      3
      2
      Votes
      3
      Posts
      1478
      Views

      @Wieland I was afraid of that. Seems like a glaring omission. Oh well, I needed to download the sources anyway to peek at Scene3D. Thanks.
    • UNSOLVED How could I improve the QObjectPicker accuracy?
      General and Desktop • qt3d • • jimfar  

      2
      0
      Votes
      2
      Posts
      345
      Views

      @jimfar Hi, I have the same problem in my Qt application... Any solutions?
    • SOLVED How to create two camera on one windows?
      General and Desktop • qt3d • • jimfar  

      4
      0
      Votes
      4
      Posts
      853
      Views

      Hi! There is an example with 4 cameras, see Multi Viewport QML Example. The example uses the QML API but porting it to C++ shouldn't be too hard.
    • SOLVED Blender Qt3D addon export error
      Tools • qt3d blender • • RandomCodeGenerator  

      5
      0
      Votes
      5
      Posts
      1195
      Views

      Hello, how to solve this problem? Could you please tell me the answer, thanks in advance!
    • SOLVED Problem with picking when QRenderSettings::renderPolicy is set to OnDemand
      General and Desktop • c++ qt3d qt5.9 picking • • iota142  

      2
      0
      Votes
      2
      Posts
      1292
      Views

      I have reported this issue on the Qt bug tracker. If someone is interested: https://bugreports.qt.io/browse/QTBUG-60738