PolytopeIntersector returns no hits when zoomed in (3.6.5)

28 views
Skip to first unread message

AndrewC

unread,
May 1, 2020, 3:06:26 PM5/1/20
to OpenSceneGraph Users
Hi,
I am using the PolytopeIntersector to select objects in a "selection box"
Works as expected in most cases.
However when I am "zoomed in" (perspective view) fairly tightly ( the eye point is inside the bounding box of the geometry), the PolytopeIntersector returns "no hits" on the geometry.

I am at my wits end on this one after walking through the OSG code, it seems to be deciding the geometry is not inside the planes of the Polytope.


Andrew



AndrewC

unread,
May 1, 2020, 4:12:29 PM5/1/20
to OpenSceneGraph Users
To answer my own question. The approach that worked was to just remove the "zNear" plane from the Polytope. It is the last plane.
Seems like an unnecessary hack.

    PolytopeIntersector* picker
      = new PolytopeIntersector ( osgUtil::Intersector::PROJECTION, nx1, ny1, nx2, ny2 );
    auto planeList = picker->getPolytope().getPlaneList();
    planeList.pop_back();
    picker->getPolytope().set ( planeList );

Reply all
Reply to author
Forward
0 new messages