semblance
02-09-2006, 05:59 AM
Hi, I have a fairly complex scene in which I'm trying to make it easy for users to click thin lines. I've got it working with gluPickMatrix: width and height are both 17. Then I use glReadPixels to sample all the pixels in the depth buffer for the 17x17 square.
My problem is that I still need the picking to be accurate - I need to give a higher priority to objects which are found at the center of the square than on the periphery.
It seems like I should be able to correspond the depth buffer value of the closest, highest-priority, non-empty pixel with a z value returned from the selection buffer. But I can't seem to convert the values to parallel ranges.
Am I going about this the right way? Any examples I can look at?
Thanks a lot.
My problem is that I still need the picking to be accurate - I need to give a higher priority to objects which are found at the center of the square than on the periphery.
It seems like I should be able to correspond the depth buffer value of the closest, highest-priority, non-empty pixel with a z value returned from the selection buffer. But I can't seem to convert the values to parallel ranges.
Am I going about this the right way? Any examples I can look at?
Thanks a lot.