Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Failed to render a OSG pointcloud with normals using QOpenGLFrameBufferObject

Failed to render a OSG pointcloud with normals using QOpenGLFrameBufferObject

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 652 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.
  • cjmdaixiC Offline
    cjmdaixiC Offline
    cjmdaixi
    wrote on last edited by
    #1

    Hi, everyone. I am currently working on a project that connects OpenSceneGraph and Qt Quick, especially to render a pointcloud with normals binding to each vertex. After searching a lot of references and materials, I decided to use QOpenGLFrameBufferObject according to the official example "textureinsgnode". I can now render the vertices in the pointcloud, however, the normals information seem to be missing (The result is a pure white pointcloud). My question is how to get my normals rendered? Some important code snippets are shown below:
    //constructing the pointcloud geometry in OSG
    geometry->setVertexArray(vertices);
    geometry->setNormalArray(normals, osg::Array::BIND_PER_VERTEX);
    pointIdx = new osg::DrawElementsUInt(osg::PrimitiveSet::POINTS);
    qint64 verticesSize = vertices->size();
    for (size_t i = 0; i < verticesSize; ++i)
    pointIdx->push_back(i);
    geometry->addPrimitiveSet(pointIdx);

    //constructing the framebufferobject in osgQuickRenderer.cpp
    QOpenGLFramebufferObject *osgQViewerRenderer::createFramebufferObject(const QSize &size)
    {
    qDebug()<<"create framebuffobject "<<size.width()<<"x"<<size.height();
    QOpenGLFramebufferObjectFormat format;
    format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    format.setSamples(4);
    return new QOpenGLFramebufferObject(size, format);
    }

    What am I missing? Any suggestion would be appreciated, thanks!

    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