Hi Peter,

Yes this is a nice precision, the euclidian distance will be a second pass to check the intersected results.

Thanks a lot :-)

Regards,
   Vincent

Le 08/09/2011 10:21, Peter Hrenka a écrit :
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
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to