Using Iphone and Objective C
Im trying to find what plane has been clicked/touched in my opengl view. Typically i would use glPushName/ flPopName but this function doesn’t seem to be implemented in the sdk or defined in . Does anyone know where to get there useful functions or another way to get the object that was clicked?
Using Iphone and Objective C Im trying to find what plane has been clicked/touched
Share
OpenGL ES doesn’t support these functions. You’ll have to find another way to pick. Either:
Render solid faces with distinct colors into a low-res buffer. Select the render buffer resolution so that the pick square occupies a 3×3 pixel grid, choose either the color in the center pixel, or the color that occupies the most edge pixels.
Determine the pick geometrically. This usually entails placing your geometry in a BSP of some sort and doing interesection tests with a ray emanating downwards into the screen, starting from the tapped pixel.
Determine the pick analytically. If you geometry is simple and/or regular enough, you might be able to use some straightforward math to find out what you tapped.