A question about OpenGL picking
-
Hi all In my project i am displaying a 3d model ( created by the marching cube algoritham) composed of triangles. This model is constructed from the 2d images slices. Now i need to select some polygons from that model. For example user drag drop and created a bounding box , and i want to get those polygons inside that bounding box.It should be fast enough (At least don't take minutes:) ). I think Opengl Picking may not work. because i can't name each polygon a unique name , because i have millions of polygons. So if i do that it may leads to statk overflow of name stack(glPushName). Any idea will be Greatly appreciated. Thanks in advance krishnan
If u can Dream... U can do it
-
Hi all In my project i am displaying a 3d model ( created by the marching cube algoritham) composed of triangles. This model is constructed from the 2d images slices. Now i need to select some polygons from that model. For example user drag drop and created a bounding box , and i want to get those polygons inside that bounding box.It should be fast enough (At least don't take minutes:) ). I think Opengl Picking may not work. because i can't name each polygon a unique name , because i have millions of polygons. So if i do that it may leads to statk overflow of name stack(glPushName). Any idea will be Greatly appreciated. Thanks in advance krishnan
If u can Dream... U can do it
krishnadevank wrote:
and i want to get those polygons inside that bounding box.It should be fast enough (At least don't take minutes ).
Several ways jump out. First You have the zone, you can render one more frame with a clip-buffer which isolates the polygons individually within the zones. You can identify which ones by coloring each differently, or split the work out, by doing so in each 2D image slice. Remember that even at 20-60hz you can take a frame to do some work and then get back to the job of drawing. Multi-rendering methods make great shortcuts. You can also use the obscure test from the ARB and setup an obscuring object everywhere except the zone of interest, and get back only those triangles within the zone. You can also do the same test as you draw, using a multi-render cycle you can check the result of the projection and write to see if it should be clipped or kept with a stencil buffer and test the triangles you need. Once again you can brute force it, or break it down, test slice by slice to see if any triangles are in the zone on cycle 0, then test those triangles in each slice one at a time for zone proximity, cycle 1+. Within a couple of frame cycles you can find all the triangles you need.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)