Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone OpenGL ES - How to Pick

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 into my opengl world and grid cell. Are there any helpers to do the reverse of last few transforms which I do for navigation ? or I should calculate and do the matrix stuff by hand ?

like image 368
Ali Nadalizadeh Avatar asked Mar 29 '10 18:03

Ali Nadalizadeh


People also ask

Does Iphone use OpenGL?

Overview. OpenGL ES provides a C-based interface for hardware-accelerated 2D and 3D graphics rendering. The OpenGL ES framework ( OpenGLES. framework ) in iOS provides implementations of versions 1.1, 2.0, and 3.0 of the OpenGL ES specification.

Does Apple support OpenGL?

OpenGL ES in particular will run on every Mac, iOS device, Android device, Windows device, and Linux device.

Is Apple removing OpenGL?

OpenGL is officially deprecated by Apple starting with macOS Mojave 10.14.

Do phones have OpenGL?

OpenGL ES 3.1. Supported by Windows, Linux, Android (since version 5.0) on devices with appropriate hardware and drivers, including: Adreno 400 series.


1 Answers

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.

like image 100
tjohns20 Avatar answered Sep 22 '22 13:09

tjohns20