Hi Vincent, Am 08.09.2011 10:00, schrieb Vincent Bourdier: > Hi Peter > > Le 08/09/2011 09:40, Peter Hrenka a écrit : >>> The goal is to compute if a point is at less than a fixed distance from >>> a node, and to my mind the intersection is the best way but maybe there >>> is something more adapted ? >> I think that should be possible. >> I would recommend using a cube which contains >> the distance-sphere as the polytope and >> check the results from the PolytopeIntersector >> for the real (euclidian) distance. >> >> I would advise against trying to >> use a "sphere"-polytope since >> the intersector must check all >> polytope-planes in the innermost loop. > > I am trying with an octaedron (8 faces) to avoid having a complex > structure (like a sphere) with too much faces, just to run some tests. > > I build the polytope a the point position (radius or the checked > distance) and compute the intersection. > If there is a least one result, I consider the point is near from the > the model. > There is no need to check the euclidian distance to my mind, isn't it ?
Well, it depends what you mean by "distance"... If the octahedron is good enough for you then you are done. But if you need to consider the exact (euclidian) distance then must choose your octahedron to contain the distance-sphere and check the results to eliminate the false-positives which lie in the octahedron but not in the sphere. > Thanks for your help. > > Regards, > Vincent Cheers, Peter -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Philippe Miltin Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org