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
Forum Updated to NodeBB v4.3 + New Features

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 2 Watching
  • 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.
  • D Offline
    D Offline
    daffmeister
    wrote on 23 Jun 2016, 06:41 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 23 Jun 2016, 07:16
    0
    • D daffmeister
      23 Jun 2016, 06:41

      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 23 Jun 2016, 07:16 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)

      D 1 Reply Last reply 23 Jun 2016, 07:20
      0
      • K koahnig
        23 Jun 2016, 07:16

        @daffmeister

        Hi and welcome to devnet forum

        Would this be sufficient Qt3D examples?

        D Offline
        D Offline
        daffmeister
        wrote on 23 Jun 2016, 07:20 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 23 Jun 2016, 07:23
        0
        • D daffmeister
          23 Jun 2016, 07:20

          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 23 Jun 2016, 07:23 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)

          D 1 Reply Last reply 23 Jun 2016, 07:31
          0
          • K koahnig
            23 Jun 2016, 07:23

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

            D Offline
            D Offline
            daffmeister
            wrote on 23 Jun 2016, 07:31 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 23 Jun 2016, 07:38
            0
            • D daffmeister
              23 Jun 2016, 07:31

              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 23 Jun 2016, 07:38 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
              • D Offline
                D Offline
                Dabulla
                wrote on 1 Aug 2016, 12:58 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 1 Aug 2016, 17:22
                0
                • D Dabulla
                  1 Aug 2016, 12:58

                  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 1 Aug 2016, 17:22 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