Having lost a couple of hours searching for a working sample of ray picking with an implementation of the gluUnProject function for iPhone OpenGL ES, and several hours making it work, we’ve decided to give it out to the community.

The interesting part of the project can be found in the glu.h / glu.c files and EAGLView.m.

The implementation of the Ray Picking algorithm can be found in the function called: checkCollision().

Here is a little sketch (that works better than a thousand words):

The project can be downloaded here: Ray Picking Project.

Project Details