[osg-users] PolytopeVisitor's sample

François Cami fcami at fedoraproject.org
Tue Apr 5 15:10:40 PDT 2016


Hi,

On Tue, Apr 5, 2016 at 11:56 AM, yusuke morikawa <y.morikawa at sanei.co.jp> wrote:
> Hello
>
> I am looking for a sample program of PolytopeVisitor in order to select plural objects( a group of points) inside the rectangular region according to the mouse rectangular selection.
> My OSG version is 3.2.1.  I am looking forward to receiving a good reply.

I don't know what you mean by "a good reply" :)

I've quickly adapted the PickingMain.cpp example from the Quick Start
Guide to be able to select (lower left to upper right) the left cow,
the right cow, or both, by using
osgUtil::PolytopeIntersector::getIntersections() instead of
osgUtil::PolytopeIntersector::getFirstIntersection().

Start reading line 236:
https://github.com/fcami/osgqsg/blob/master/Examples/Picking/RectangularPickingMain.cpp

I'm using OpenSceneGraph 3.4.0 but the code should work with 3.2.1.

HTH
François



More information about the osg-users mailing list