OpenGL picking
-
I have a very big view (i.e. city) with so many detailes on it, and it consumes time to draw/redraw it. My problem is: :((to select a street from that city, I have to ReDraw the scene/the whole city to do the picking and see the detailes of that street. Does any one know how to do the selection / picking without redrawing every thing ? :rose:Thank you
-
I have a very big view (i.e. city) with so many detailes on it, and it consumes time to draw/redraw it. My problem is: :((to select a street from that city, I have to ReDraw the scene/the whole city to do the picking and see the detailes of that street. Does any one know how to do the selection / picking without redrawing every thing ? :rose:Thank you
belloSoft wrote:
My problem is: to select a street from that city, I have to ReDraw the scene/the whole city to do the picking and see the detailes of that street. Does any one know how to do the selection / picking without redrawing every thing ?
There are two ways to do picking, three if you count hybrids, but we'll stick with two. One uses the draw cycle evaluating which pixel you touched and what triangle it belongs to, and what group that triangle lies within, etc. That is hardware based and limited by the options available in hardware. http://web.engr.oregonstate.edu/~mjb/cs553/Handouts/Picking/picking.pdf[^] I assume from your message you are doing this. The second type is via proximity or at least via spatial zone. There are many algorithms a google on "ray intersection octree" or "ray intersection triangle" will produce many ansers. For instance: http://giig.ugr.es/~rgarcia/Poster.pdf[^] You can also do cheap bounding box tests mathematically for large regions. A quad-tree search within a scene for a "picked" locaton can quickly differenciate what object (or objects) you are looking at, and then you can either do a ray-triangle test to find a specific triangle of that subset, or an OpenGL pick of ONLY those few objects of relative usefullness. There is also obscuration testing. This is fairly new (last few generations) but certainly no longer leading edge stuff, but it will allow you to quickly reduce the objects being drawn to only those visible using an occlusion query. The more you can do to "cut down" what you draw the faster your draw-time. Why draw it at all if it is off the screen? why draw it if it is entirely hidden by another building? etc. Occlusion Query[^]
_________________________ Asu no koto o ieba, tenjo de nezumi g
-
belloSoft wrote:
My problem is: to select a street from that city, I have to ReDraw the scene/the whole city to do the picking and see the detailes of that street. Does any one know how to do the selection / picking without redrawing every thing ?
There are two ways to do picking, three if you count hybrids, but we'll stick with two. One uses the draw cycle evaluating which pixel you touched and what triangle it belongs to, and what group that triangle lies within, etc. That is hardware based and limited by the options available in hardware. http://web.engr.oregonstate.edu/~mjb/cs553/Handouts/Picking/picking.pdf[^] I assume from your message you are doing this. The second type is via proximity or at least via spatial zone. There are many algorithms a google on "ray intersection octree" or "ray intersection triangle" will produce many ansers. For instance: http://giig.ugr.es/~rgarcia/Poster.pdf[^] You can also do cheap bounding box tests mathematically for large regions. A quad-tree search within a scene for a "picked" locaton can quickly differenciate what object (or objects) you are looking at, and then you can either do a ray-triangle test to find a specific triangle of that subset, or an OpenGL pick of ONLY those few objects of relative usefullness. There is also obscuration testing. This is fairly new (last few generations) but certainly no longer leading edge stuff, but it will allow you to quickly reduce the objects being drawn to only those visible using an occlusion query. The more you can do to "cut down" what you draw the faster your draw-time. Why draw it at all if it is off the screen? why draw it if it is entirely hidden by another building? etc. Occlusion Query[^]
_________________________ Asu no koto o ieba, tenjo de nezumi g