iPhone OpenGL ES - How to Pick

后端 未结 3 819
说谎
说谎 2021-01-05 12:36

I\'m working on an OpenGL ES1 app which displays a 2D grid and allows user to navigate and scale/rotate it. I need to know the exact translation of View Touch coordinates in

3条回答
  •  时光取名叫无心
    2021-01-05 13:27

    Sounds like what you're looking for is an unproject method. The glut library comes with one, but it's not available on OpenGL ES. It's possible to rewrite the glut code yourself to be iphone compatible You could also write your own code to unproject, which would involve needing to scale the touchpoint to your viewport, multiply it by the inverse of your projection*modelview matrices, and divide by w to get a 3D vector.

提交回复
热议问题