tags:

views:

59

answers:

2

Hi,

I'm working on a select function in a program that will select the vertex closest to a specific touch point (iPhone development). My idea for finding this point is to find the screen coordinates of all the significant vertices, find the screen vertex that gives the minimum distance between the touch point and that vertex, and then use the relationship to get the object vertex and the object coordinates.

So my question is, how would I find the screen coordinates of the vertex? I'm using VBOs.

A: 

Just apply your GL_PROJECTION and GL_MODELVIEW matrices to your vertexes.

genpfault
OpenGL-ES does not have gluProject.
Emil
A: 

Since gluProject is unavailable in OpenGL-ES, you will have to perform the projection yourself.

This post might be helpfull, even though it deals with the gl-implementation on the NDS. The accepted answer however is valid for the general case.

sum1stolemyname