Tag: raytracing

更新iPad Retina的OpenGL ES触摸检测(光线追踪)?

我有下面的代码,我正在使用光线追踪。 该代码可以在非视网膜iPad上成功运行,但不能在视网膜iPad上运行。 触摸被检测到,但是转换后的点在左边,在下面。 任何人都可以build议如何更新下面以适应视网膜屏幕? – (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, […]