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

3D Object seems to be shifted when picking with QObjectPicker



  • Qt3d; QObjectPicker; PrimitivePicking;

    Hi all,

    I have an issue with QObjectPicking. I tried to pick triangles on a custom mesh. Therefore I added the QObjectPicking object to the root entity. For rendereing, I used Qt's

    Qt3DExtras::QForwardRenderer()
    

    The picking is performed by:

    //picking
    Qt3DRender::QObjectPicker *picker = new Qt3DRender::QObjectPicker(m_pRootEntity);
    m_pRootEntity->addComponent(picker);
    connect(picker, &Qt3DRender::QObjectPicker::pressed,
    this, &View3D::handlePickerPress);
    Qt3DRender::QRenderSettings* renderSettings = new Qt3DRender::QRenderSettings(m_pRootEntity);
    renderSettings->pickingSettings()->setPickMethod(Qt3DRender::QPickingSettings::PrimitivePicking);
    renderSettings->pickingSettings()->setPickResultMode(Qt3DRender::QPickingSettings::NearestPick);
    // renderSettings->pickingSettings()->setWorldSpaceTolerance(0.1f);
    m_pRootEntity->addComponent(renderSettings);
    

    Now the issue:

    When clicking on the 3D object within our 3D view, the object seems to be shifted. So it happens that the QPickEvent is trigered if the object is still far away, whereas on the other extreme, the event is not triggered if clicking on the 3D object. The issue seems to be comparable to
    https://forum.qt.io/topic/117195/qpickingsettings-does-not-change-the-behaviour

    Further information:
    Qt 5.14.2
    Windows 10


Log in to reply