I am trying something like a math plotter application that shows a series of polygons (GL_LINE_STRIP) and allows me to click on one of them to get the index of this polygon. One polygon has one name.
First I thought everything works fine: I could click on the lines, got their index and could display them in a different color.
But now I noticed that sometimes this doesn’t work. There are some points in my scene where I get more hits than I should. I walk along one of the polygons and repeat clicking on it with distances of some pixel. On most positions I get the name of this polygon but when I move lets say 3 pixels further I get 2 or 3 or even 4 hits! The correct one is among them but the others really shouldn’t be there. When I continue along the polygon the result is ok.
And I can repeat this behavior going backwards: At the same position I get more hits and get only one when I am back at the start position.
I commented out the glRenderMode(GL_SELECT) statement so that I can see what’s inside my picking area and there really is only one polygon. But still when I switch back to render mode I get more than one hit.
What’s that? Where do these hits come from?
I know that there are some things you can do wrong and it took me some time to get this far ( but when I see that there is just one line in my pick box what else can cause this behavior?
I read a lot in the forum where people are complaining about OpenGL picking but this is basic stuff and should work, right? So I guess I made a mistake but where?
Thanks for any helping hint!