Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. 3D Object seems to be shifted when picking with QObjectPicker

3D Object seems to be shifted when picking with QObjectPicker

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 178 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.
  • R Offline
    R Offline
    RuDo
    wrote on last edited by RuDo
    #1

    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

    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