Skip to main content
gamedev.net
🔒 Locked

Question about picking

Started by Odiee Jul 2, 2008 at 8:38 AM 0 replies 800+ views
Original Post
Odiee
Odiee
I'm reading tutorials about picking and selecting of objects in openGL and it reads that this is done by naming and GL_SELECT rendering of objects. The list of hits is then stored in a buffer with hit's depth. It is also said that the selected object is the one closes to the viewer. (camera) But here's the question. What happens when 2 or more objects are in the same distance from the camera? Also I have 2 glspheres posistioned 5,5,0 and 10,10,0. Initialized like this

for (int c=0;c<2;c++)
    {
     glPushMatrix();
     glPushName(c);
     glPopName();
     glPopMatrix();
    }
Hit is detected for each object but no data is in buffer. What did I do wrong?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.