Re: [osg-users] Bigger bounding box to make picking (intersection) easier?
osg::Box is the thing you are after. Create a ShapeDrawable for one, and add it to a group that is part of, or that contains your cow model. Then set node flags or a cull callback to make the ShapeDrawable invisible, and if you like, you could also set flags on the intersection visitor to only attempt to make intersections with your new collision boxes. Alistair Baxter Software Engineer Join us for the 2014 Houston Roadshow on 4th April More details on our Calendar: http://www.mve.com/calendar Midland Valley Exploration Ltd. 144 West George Street Glasgow G2 2HG United Kingdom Tel: +44 (0) 141 332 2681 Fax:+44 (0) 141 332 6792 The structural geology experts ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bigger bounding box to make picking (intersection) easier?
Ahoj Petr, you can override the bound volume calculation with your own code via callback. Have a look in the Node class /** Callback to allow users to override the default computation of bounding volume.*/ struct ComputeBoundingSphereCallback : public osg::Object { virtual BoundingSphere computeBound(const osg::Node) const { return BoundingSphere(); } }; so here you do the default Node::computeBound and adjust the radius by something small (like radius *= 1.1) Hope this helps Nick On Fri, Mar 28, 2014 at 10:00 PM, Petr Svoboda upd...@seznam.cz wrote: Hi, I would like to ask if there is some way how to create bigger bounding box over some model to make it easier to pick it/ intersect with. For example if there is a cow.osg model and I want to pick it then how do it in a way that I dont need to click with my mouse exactly on that model but a bit next to it. Is that was is osg::BoundingBox made for? Or the purpose of BoundingBox is just for culling etc.? I would like to use osg::LineSegmentIntersector + osg::IntersectVisitor. Thank you! Cheers, Petr -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58760#58760 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bigger bounding box to make picking (intersection) easier?
HI Petr, The ray intersection testing goes right down to the polygon level when testing for intersection so expanding the bounding box won't make any difference. Perhaps what you are looking for is the PolytopeIntersector, this allows you to create a screen aligned polytope that can intersection objects within the polytope. Robert. On 28 March 2014 21:00, Petr Svoboda upd...@seznam.cz wrote: Hi, I would like to ask if there is some way how to create bigger bounding box over some model to make it easier to pick it/ intersect with. For example if there is a cow.osg model and I want to pick it then how do it in a way that I dont need to click with my mouse exactly on that model but a bit next to it. Is that was is osg::BoundingBox made for? Or the purpose of BoundingBox is just for culling etc.? I would like to use osg::LineSegmentIntersector + osg::IntersectVisitor. Thank you! Cheers, Petr -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58760#58760 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org