title: Updating OpenGL ES Touch Detection (Ray Tracing) for iPad Retina?
body: <p>I have the below code which I am using for ray tracing. The code works successfully on non-retina iPads, however does not function on the retina iPads. The touch is detected, however the converted point is off to the left and below where it should be. Can anyone suggest how I can update the below to accommodate the retina screen ?</p>
  
  <pre><code>- (void)handleTap: (UITapGestureRecognizer *)recognizer
  {
  
      CGPoint tapLoc = [recognizer locationInView:self.view];
  
      bool testResult;
  
      GLint viewport[4];
      glGetIntegerv(GL_VIEWPORT, viewport);
  
      float uiKitOffset = 113; //Need to factor in the height of the nav bar + the height of the tab bar at the bottom in the storyboard.
  
      GLKVector3 nearPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-1024+uiKitOffset)*-1, 0.0), modelViewMatrix, projectionMatrix, &amp;viewport[0] , &amp;testResult);
  
      GLKVector3 farPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-1024+uiKitOffset)*-1, 1.0), modelViewMatrix, projectionMatrix, &amp;viewport[0] , &amp;testResult);
  
      farPt = GLKVector3Subtract(farPt, nearPt);
  
      for (Object * Object in self.objectArray) {
  
          ...
  
  } 
  </code></pre>