Hi there...

How can I select 3d objects in OpenGL ES 1.1 ?

My application is for iPhone OS and it works in perspective
3d and when the user touch in the screen any objects must
be select or not. The application have boxes, spheres, teapots, tubes,
torus and others geometric objects.

In OpenGL I have the solution but in OpenGL ES 1.1 many functions are not suported.

look de code in OpenGL below.

unsigned int obj_sel(const int max, unsigned int buffer[])
{
float menor_z = 1.0;
unsigned int menor = 0;
unsigned int *ptr = buffer;

for (int i = 0; i < max; ++i)
{
*ptr++; float zmin = (float)*ptr++ / 0xffffffff; *ptr++;
if (zmin < menor_z){ menor = *ptr; menor_z = zmin;} ptr++;
}

return menor;
}

unsigned int select_object()
{
int viewport[4];
unsigned int select[3000];

glSelectBuffer(3000, select); glRenderMode(GL_SELECT);
glInitNames(); glPushName(0); glMatrixMode(GL_PROJECTION);

glPushMatrix();
glGetIntegerv(GL_VIEWPORT, viewport); glLoadIdentity();
gluPickMatrix((double)x, (double)viewport[3] - y, 1.0, 1.0, viewport);
gluPerspective(45.0, (float)480 / (float)320, 1.0, 1000.0);
glMatrixMode(GL_MODELVIEW); draw_scene(true); glMatrixMode(GL_PROJECTION);
glPopMatrix();

glMatrixMode(GL_MODELVIEW); glFlush(); int max = glRenderMode(GL_RENDER);
return obj_sel(max, select);
}

it not work very well in OpenGL ES 1.1 because
glSelectBuffer(), glRenderMode(GL_SELECT),
glInitNames(), glPushName() and glLoadName() are not supported

I have finding in web sites for (picking, selection in OpenGL ES...)
but no results. Someone know where can I find it ?
maybe books, web sites, links or tutorials... any help will be usefull... thanks to all...