Re: [osg-users] PolytopeIntersector usage
Hi Vincent, Am 08.09.2011 08:51, schrieb Vincent Bourdier: Hi all, I'm currently trying to compute an intersection between a sphere and a node. PolytopeIntersector seems to be the best choice according to the documentation, but I didn't find any example of implementation. Have a look at the osgkeyboardmouse example. Next, are there some limitations to its usage ? (I saw something about convex clipping volumes...) PolytopeIntersector is mostly useful when used for interactive picking with small volumes. Its return data structure is too big for large volumes (containing lots of intersections). 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. 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
Re: [osg-users] PolytopeIntersector usage
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 ? Thanks for your help. Regards, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PolytopeIntersector usage
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
Re: [osg-users] PolytopeIntersector usage
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