Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-05 Thread Chris Hanson
If you are achieving .01ms with your current hardware and model, and you are happy with that, by ALL means, you should not put further effort into it. I remarked as much for other's benefit and for those who might read the thread in the future and wonder about strategies for working with more

Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-05 Thread Andrea Martini
Hi Chris Hanson, thank you for your suggestion and your advanced solution. However, the Robert Osfield's answer solved completely issues concerning my unclear question. At the moment i find very hard to improve (using my equipment) performance beyond 0.01 ms. Anyway, i will take in

Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-05 Thread Chris Hanson
Here's one take on the matter: http://ogldev.atspace.co.uk/www/tutorial29/tutorial29.html ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-05 Thread Chris Hanson
Do you only need drawable-level discrimination? You can spend a lot of effort intersection testing each polygon on the CPU. You can also offload a lot of the work onto the GPU, but OSG doesn't do this for you. If you only need the ray hit closest to the Eye, you can also use a variant of Picking

Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-05 Thread Andrea Martini
Hi Robert, thank you for your suggestion. After using of : osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::Options::BUILD_KDTREES); and osgUtil::IntersectionVisitor iv(intersector.get()); iv.setUseKdTreeWhenAvailable(true); intersector visitor performances are good again. Now, the

Re: [osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-04 Thread Robert Osfield
Hi Andrea, The osg::KdTree is design for the purpose of accelerating intersection testing. What you need to do is run the KdTreeBuilder visitor on your subgraph to generate KdTree for each osg::Geometry in the subgraph, these then get assigned automaticaly to each osg::Geometry as a Shape. The

[osg-users] osgUtil::LineSegmentIntersector performance issues

2018-12-04 Thread Andrea Martini
Hello everyone, i spent my last weeks to find a reasonable cause concerning osgUtil::LineSegmentIntersector on some osgt file. In detail, i would like to identify objects in the scene, using line isector (ray casting) starting from a certain point with a ray of 3 meter length . Following the