Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Simple example of displaying a point in Qt3D

    Game Development
    qml qt3d qt3d 2.0
    4
    8
    4994
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • daffmeister
      daffmeister last edited by koahnig

      I'm porting an application based on Qt3D v.1 to Qt3D v.2 (Qt5.7).

      As a very simple starting place I just need to display a bunch of points (ideally with colour and size). Are there any examples of such a simple application?

      Thanks, Dave.

      K 1 Reply Last reply Reply Quote 0
      • K
        koahnig @daffmeister last edited by

        @daffmeister

        Hi and welcome to devnet forum

        Would this be sufficient Qt3D examples?

        Vote the answer(s) that helped you to solve your issue(s)

        daffmeister 1 Reply Last reply Reply Quote 0
        • daffmeister
          daffmeister @koahnig last edited by

          Thanks @koahnig,

          I've looked at the examples but they implement meshes with material properties, which I think is too heavy for what I need (ultimately a point cloud with 100,000's of points, so a sphere with fancy shading isn't going to work).

          K 1 Reply Last reply Reply Quote 0
          • K
            koahnig @daffmeister last edited by

            @daffmeister

            You would have to "thin out" one of the examples I guess. At least that would be my approach. Unfortunately I am not in QML and useless there.

            Vote the answer(s) that helped you to solve your issue(s)

            daffmeister 1 Reply Last reply Reply Quote 0
            • daffmeister
              daffmeister @koahnig last edited by

              Hi @koahnig,

              That's what I've done so far, giving me this fragment:

              Qt3DCore::QEntity *createScene()
              {
                  Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity;
                  Qt3DRender::QMaterial *material = new Qt3DExtras::QPhongMaterial(rootEntity);
                  Qt3DCore::QEntity *sphereEntity = new Qt3DCore::QEntity(rootEntity);
                  Qt3DExtras::QSphereMesh *sphereMesh = new Qt3DExtras::QSphereMesh;
                  ...
                  (set sphereMesh properties)
                  ...
                  sphereEntity->addComponent(sphereMesh);
                  sphereEntity->addComponent(material);
                  }
                  return rootEntity;
              }
              

              which I then view. That only scales to about a thousand points though before it starts slowing down (not surprising since it's rendering actual spheres). So I need simpler primitives.

              K 1 Reply Last reply Reply Quote 0
              • K
                koahnig @daffmeister last edited by

                @daffmeister

                I will mark this post and call for moderation. Someone else should be of more use here.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply Reply Quote 0
                • Dabulla
                  Dabulla last edited by

                  Hello,

                  I created a Qt3DPointcloudRenderer https://github.com/MASKOR/Qt3DPointcloudRenderer

                  It can render Pointcloud Library PCLPointcloud2.

                  If you already have your Vertexbuffer ready, you can simply use

                  GeometryRenderer {
                      geometry: (...)
                      primitiveType: GeometryRenderer.Points
                  }
                  

                  and RenderState

                  StateSet {
                      renderStates: [
                          PointSize { specification: PointSize.Programmable },
                          (...)
                      ]
                  }
                  

                  (PointSize seems to be broken in Qt version 5.7. The Application might crash on exit.)

                  ? 1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User @Dabulla last edited by

                    @Dabulla Hi! Would be great if you'd file a bug report for this PointSize RenderState issue. Thank you :)

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post