Hi Lars, Thanks for the fix and test example. I've merged most of your changes to KdTree - in particular the change in parameter Vec3d type to the KdTree::intersect() method, and in the IntersectKdTree constructor.
I didn't find it necessary to merge the change the IntersectKdTree::intersect method as it's internal maths is all Vec3 based so I didn't see any advantage in making this change. Your test example works fine without merging this. As a more general issue, I do wonder about whether we should still instigate a full Vec3d/Vec3 implementation where the later can be used for speed, and the full Vec3d math version used where precision is more critical. There is a limit on precision though as the vertex data on geometry is in Vec3's. The combined changes are now checked into svn/trunk. Could you please test with your application/datasets to make sure that things are still working at your end. Cheers, Robert. On Tue, Jan 19, 2010 at 4:49 PM, Nilsson Lars <[email protected]> wrote: > Hi Robert > > > > Attached is a small program doing intersection calculations, both with and > without KdTree. The geometry is a TRIANGLE_STRIP consisting of five > vertices, all with the same rather high Z-value. If the intersection > calculation uses KdTree, it fails. When I changed osg::Vec3 to osg::Vec3d in > a few places in osg::KdTree it finds the correct intersection point. > > > > Another way to solve the problem was to increase the expansion of the > bounding-box in osgUtil::LineSegmentIntersector::intersectAndClip. > > > > The version of OSG that I use is 2.9.6. > > > > Because I do not have enough knowledge in KdTree to understand what other > implications these changes may have, I tried a week ago to start a > discussion in osg-user mailing list to find out if either of these fixes > seems to be reasonable. But there was no response. Now it is up to you to > decide which one, or none of them to be used. > > > > Regards, > > Lars Nilsson > > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
