   Picking problem
  Hi,Picking procedure from my game looks like this(i had copied it from tut) . . .hits= glRenderMode (GL_RENDER);  if (hits != 0)  {    ptr = (GLuint *) buffer;   minZ = 0xffffffff;   for (i = 0; i < hits; i++) { names = *ptr;  ptr++;  if (*ptr < minZ) {  numberOfNames = names;  minZ = *ptr;  ptrNames = ptr+2;  }  ptr += names+2;}   ptr = ptrNames; Process(numberOfNames,ptr);. . .This procedure returns names of objects which are "on the top".Do anyone know how to change it to return all names?thx 4 respons   
  Looks like the Lighthouse3D code :) If you took it directly from red book, this explanation might help.Think about it logically, if you want all the names and not just the closest name, then you will have to save them from the inner loop. You shouldn't check for if "(*ptr < minZ)" but instead just return them all.   