Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
Hi Wang, Rob, Peter, Thanks for your replies. I try using CylinderIntersector and post my feedback. Cheers, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37343#37343 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
Hi Sanat, The way I would tackle the task would be to write a ClinderIntersector class along the lines of the existing osgUtil::LineSegmentIntersector. The only major difference would be how you do the intersection tests with the bounding spheres, and bounding boxes of the nodes during the IntersectionVisitor traversal, and the intersection tests of the cylinder against the geometry data found in the Drawable leaves. Robert. On Thu, Mar 3, 2011 at 7:21 PM, Sanat Talmaki wrote: > Hi, > > I want to test for intersection in my scene using a cylinder instead of a > line segment. > > For example if my object is on a terrain I want to highlight all features > that are within an imaginary cylinder around my object. > > I read about polytope intersector but it seems as though that is for planes > only or can I get cylinder intersector from there as well ? > > Any tips on how I can get started will be much appreciated. > > Thanks! > > Sincerely, > Sanat. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=37298#37298 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
Hi Sanat, Am 03.03.2011 20:21, schrieb Sanat Talmaki: > Hi, > > I want to test for intersection in my scene using a cylinder instead of a > line segment. > > For example if my object is on a terrain I want to highlight all features > that are within an imaginary cylinder around my object. > > I read about polytope intersector but it seems as though that is for planes > only or can I get cylinder intersector from there as well ? You could use the PolytopeIntersector with a hexagonal shape which envelops the cylinder and post-process the results. This sould give you a good aproximation and little false positives. As was noted by Chris PolytopeIntersector can be very slow if there are many Intersections in the picking volume. That is because every primitive and every vertex that is inside the volume is recorded in the result. The kd-tree is not integrated into PolytopeIntersector as of now. > Any tips on how I can get started will be much appreciated. > > Thanks! > > Sincerely, > Sanat. > > -- 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: Michel Lepert 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] How to Develop/Create a Cylinder Intersector ??
Hi Sanat, My suggestion is to design a CylinderIntersector yourself and add it to the IntersectionVisitor. The most important methods to override will be: // Make a clone of the intersector for the visitor to use internally, don't forget to set clonedIntersector->_parent = this virtual Intersector* clone( osgUtil::IntersectionVisitor& iv ); // Check if a node is intersected with the cylinder and return true if we should continue traversing the subgraph virtual bool enter( const osg::Node& node ); // Check if a drawable is intersected with the cylinder and record the results in any forms you want (like an Intersection list) virtual void intersect( osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable ); Then you may make use of some simple math formulas instead of adding a lot of planes. Have a look at the implementation of LinesegmentIntersector will be of help. Cheers, Wang Rui 2011/3/4 Sanat Talmaki : > Hi, > > I want to test for intersection in my scene using a cylinder instead of a > line segment. > > For example if my object is on a terrain I want to highlight all features > that are within an imaginary cylinder around my object. > > I read about polytope intersector but it seems as though that is for planes > only or can I get cylinder intersector from there as well ? > > Any tips on how I can get started will be much appreciated. > > Thanks! > > Sincerely, > Sanat. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=37298#37298 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
On 3/3/2011 2:31 PM, Sanat Talmaki wrote: > Hi Chris, > Ok. I will try that approach. But if I need to use several planes say > something like an octagon or even higher number of sides, will that reduce > performance terribly ? I don't have any personal experience, but I've heard polytope can be quite slow. I think the KD tree stuff might speed it up, but that's just a guess. > Thanks, > Sanat -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
Hi Chris, Ok. I will try that approach. But if I need to use several planes say something like an octagon or even higher number of sides, will that reduce performance terribly ? Thanks, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37301#37301 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Develop/Create a Cylinder Intersector ??
On 3/3/2011 12:21 PM, Sanat Talmaki wrote: > I read about polytope intersector but it seems as though that is for planes > only or can I get cylinder intersector from there as well ? > Any tips on how I can get started will be much appreciated. I think you'd have to assemble an approximate cylinder out of planes. > Thanks! > Sincerely, > Sanat. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to Develop/Create a Cylinder Intersector ??
Hi, I want to test for intersection in my scene using a cylinder instead of a line segment. For example if my object is on a terrain I want to highlight all features that are within an imaginary cylinder around my object. I read about polytope intersector but it seems as though that is for planes only or can I get cylinder intersector from there as well ? Any tips on how I can get started will be much appreciated. Thanks! Sincerely, Sanat. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37298#37298 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org