title: converting 2D mouse coordinates to 3D space in OpenGL ES
body: <p>I want to convert mouse's current X and Y coordinates into the 3D space I have drawn in the viewport. I need to do this on the OpenGL ES platform. I found following possible solutions implemented in OpenGL, but none fits what I am looking for.</p>
  
  <ol>
  <li><p>I found NeHe's tutorial on doing exactly this, but in traditional OpenGL way. It uses gluUnProject.
  <a href="http://nehe.gamedev.net/data/articles/article.asp?article=13" rel="nofollow noreferrer">http://nehe.gamedev.net/data/articles/article.asp?article=13</a>
  Although gluUnProject is not available in OpenGL ES, its implementation seems simple enough to port back. But before calling it, we need to call glReadPixels with GL_DEPTH_COMPONENT and that is not possible in OpenGL ES. (The reason I found in this thread: <a href="http://www.khronos.org/message_boards/viewtopic.php?f=4&amp;t=771" rel="nofollow noreferrer">http://www.khronos.org/message_boards/viewtopic.php?f=4&amp;t=771</a>)</p></li>
  <li><p>What I want to do is similar to picking, except that I don't want to select the object but I want exact coordinates so that I can recognize particular portion of the object that is currently under mouse cursor. I went through the Picking tutorials in this answer.
  <a href="https://stackoverflow.com/posts/2211312/revisions">https://stackoverflow.com/posts/2211312/revisions</a>
  But they need glRenderMode, which I believe is absent in OpenGL ES.</p></li>
  </ol>
  
  <p>If you know how to solve this problem in OpenGL ES, please let me know.</p>
  
  <p>Thanks.</p>