PDA

View Full Version : Picking problem



KurtCob
05-21-2001, 02:22 AM
Hello guys.

I'm trying to implement picking with glSelect, is is working but if I have picked one object like in the point that it intersect with another, I have problems, I think it will generate more than one hit, right ? Ok this is working :



if(hits == 1) Perform_Selection();
if(hits > 1) // Show a special message


The message is being displayed, but now, how to control the ID of the next hit (next object) ??

Hope I'm clear enough.
Thank you for the moment.
Best regards.
Kurt

KurtCob
05-22-2001, 01:09 AM
....

Brent Fogarty
05-22-2001, 01:43 AM
You need to move through the buffer specified in glSelectBuffer looking for the hit with the closest z value. I think Each hit fills up 4 elements in the buffer, the 2nd is the z value, and the 4th is the Name that you gave the object. Someone correct me if I'm wrong please.

Hope that helps