View Full Version : OGL selection vs strip stitching

speedy gonzalez
05-03-2006, 02:41 PM
I have an object with triangle strips.
I just modified the stripifier so it merges all the strips using a degenerated triangle.
It works fine except for the selection.
I implemented the selection using the standard OpenGL technique (glSelectBuffer, glPushName, glPopName, etc) but if I happen to do a rectangle selection over the degenerated triangle (that you dont see) OpenGL will find an intersection and I will end up selecting that object as well...

Is there anything I could do to avoid this ?

05-03-2006, 02:49 PM
i suppose the best way would be loop throiugh all the selected tris and check if theyre degenerant (ie use the same vertice more than once) if so disregard them

speedy gonzalez
05-03-2006, 03:05 PM
No that wont work because I only use a single call to glPushName for the entire object so it's either the entire object intersects or it doesnt intersect. Calling glPushName at every triangle would be too slow for large objects.

05-03-2006, 05:15 PM
I don't think there are any other solutions. Maybe you'll have to keep in your program the indices of the degenerated triangles so that it could speed up things a bit.

speedy gonzalez
05-03-2006, 08:11 PM
Thank you all.
I finally found the solution.
I will effectively keep where are my degenerated triangles in my _long_ strip and during picking I will draw the separated non-stitched strips to avoid the problem. During normal drawing I will draw my _long_ strip in a single OpenGL call.

Mikkel Gjoel
05-05-2006, 09:19 PM
An extension of this might be to use a decimated mesh for selection determination - ie. use a mesh with less detail. If you have access to a low LOD version of the mesh (e.g. for intersections or collision-detection) you might as well use it for this task also.