Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Draw 3D points



  • Hello,

    I have a small matrix of 3d points from a RGBD camera and I want to do something like this in Qt

    https://www.youtube.com/watch?v=aSVprdtz2bo

    What should be the way to do this? I don't have any experience on OpenGL so I'm looking if Qt3D is an option.

    Thank you

    PS: I saw some information on Game Development, move my topic there if you think I'll get more help there.



  • @metRo_ Hi! If you want to do anything serious with Qt3D then this means you'll have to implement your own scene objects (with C++ and OpenGL) and implement a custom render pipeline (with QML and the various different OpenGL shader types). So, you'll have to learn modern OpenGL. Don't think of Qt3D as a replacement for OpenGL but more of a QML scene graph that nicely integrates into QtQuick.



  • @Wieland so isn't there an easy way? :p
    Any guide/tutorial on how to start?



  • Well, there are two kinds of OpenGL: Modern OpenGL with shaders and legacy OpenGL. Legacy OpenGL is easy to learn and easy to use in Qt. Basically you only need to know how to use QOpenGLWidget and drawing some points with legacy OpenGL isn't very much more than...

    // here "p" is a QList<QVector3D>, just for the example
    glBegin(GL_POINTS);
    for (int i=0; i<p.size(); i++) {
        const QVector3D point = p.at(i);
        glVertex3f( point.x(), point.y(), point.z() );
    }
    glEnd();
    

    I'd say learning some legacy OpenGL will be less work then learning the use of Qt3D or any other sceen graph (e.g. OSG).



  • @Wieland thank you, I'll start there. What I'll learn using legacy OpenGL will be important when change to Modern OpenGL?



  • @metRo_ Yes, the basic concepts apply to both.


Log in to reply