HI Aurelien, On Tue, Oct 11, 2011 at 7:08 PM, Aurelien Albert <[email protected]> wrote: > > We use an algorithm with a "intersection distance" parameter : if minimum > distance between the two lines (or segment, or line/segment) is below this > minimum, we consider that the lines intersect. > > It acts like intersecting cylinders (infinite or not) with a little diameter.
If it walks like a duck and quacks like a duck it's a duck :-) I would suggest that you call your class CylinderIntersector and set it up as such, it will do what you need an keep things clear it what it implements. > I'm trying to extends LineSegmentIntersector with new features. I wouldn't recommend extended LineSegmentIntersector, rather implement your own subclass from the base class osgUtil::Intersector. A Cylinder intersections have different properties than a Line intersections, including the data you'd put into the Intersection objects that describe your hits. I would recommend look at how the PolytopeIntersector and LineSegmentIntersector are similar and differ to see how to go about a CylinderIntersector. > There are different goals : > - personal training > - test our algorithm in a OSG context (actually all rendering is done in pure > OpenGL, all computation in standard C++) > - use this algorithm on a standard OSG scene to do some computations (like in > our actual software) > - maybe use this algorithm for screen picking >From screen picking with an orthographic view a CylinderIntersector would be appropriate, but for a perspective view a ConeIntersector would be more appropriate to handle the fact the as you move further away from the eye point an one screen pixel occupies a greater area in the object coordinates. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

