Hi,

I've a scene with only a handful of Geodes (under 200). 
If I wanted to detect which objects were "selected" within a 2D rectangle on 
screen (think clicking, holding, dragging out a rectangle over the view) - 
would a PolytopeIntersector be a good choice?


Code:

osgUtil::PolytopeIntersector *picker = new osgUtil::PolytopeIntersector(cf,
    fmin(downX, lastX), 
    fmin(downY, lastY),
    fmax(downX, lastX),
    fmax(downY, lastY));
osgUtil::IntersectionVisitor iv(picker);
view->getCamera()->accept(iv);
if(picker->containsIntersections()) {
   // do stuff
}




I ask because I've tried (using the above) - where downX/Y are filled in on 
mouse down - and as soon as the selection encompasses a number of geodes it 
really slows down, considerably (I'm doing this every time the mouse position 
changes, e.g: ::DRAG).  I suspect I'm doing something wrong / using the 
polytope incorrectly perhaps?

Any pointers?
I'm considering using a nodemask to only examine the few things I need to test 
for (ends up being about 12 quads). But wondering if I'm doing things 
incorrectly from the outset...

Cheers,
Neil

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=22664#22664





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to