Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Simple example of displaying a point in Qt3D

Simple example of displaying a point in Qt3D

Scheduled Pinned Locked Moved Unsolved Game Development
qmlqt3dqt3d 2.0
8 Posts 4 Posters 6.1k Views
  • 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.
  • daffmeisterD Offline
    daffmeisterD Offline
    daffmeister
    wrote on last edited by koahnig
    #1

    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
    0
    • daffmeisterD daffmeister

      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 Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @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)

      daffmeisterD 1 Reply Last reply
      0
      • K koahnig

        @daffmeister

        Hi and welcome to devnet forum

        Would this be sufficient Qt3D examples?

        daffmeisterD Offline
        daffmeisterD Offline
        daffmeister
        wrote on last edited by
        #3

        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
        0
        • daffmeisterD daffmeister

          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 Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @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)

          daffmeisterD 1 Reply Last reply
          0
          • K koahnig

            @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.

            daffmeisterD Offline
            daffmeisterD Offline
            daffmeister
            wrote on last edited by
            #5

            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
            0
            • daffmeisterD daffmeister

              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 Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              @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
              0
              • DabullaD Offline
                DabullaD Offline
                Dabulla
                wrote on last edited by
                #7

                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
                0
                • DabullaD Dabulla

                  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.)

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved