Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open GL ES on Android: how to use gluUnProject?

I'm trying to convert window coordinates to object coordinates. There's a gluUnProject in GLU class, which requires current modelview, projection matrices and viewport.

My question is how to get those matrices? I tried gl.glGetIntegerv (GL11.GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES, model, 0); and ((GL11) gl).glGetFloatv(GL11.GL_MODELVIEW_MATRIX, modelf, 0); but the first one returns an array of zeros, and the other one just shows an "method not implemented" error.

Is gluUnProject the correct method for this purpose (i.e. window coordinates --> object coordinates) ?

like image 243
focuser Avatar asked Feb 25 '09 23:02

focuser


People also ask

Can I use OpenGL on Android?

The basics. Android supports OpenGL both through its framework API and the Native Development Kit (NDK).

How does OpenGL work in Android?

OpenGL in Android is a graphics library that is used for 2D and 3D graphics development in Android applications. OpenGL provides cross-platform APIs. It processes high-performance data transfer between CPU and GPU. OpenGL supports the android native development kit(NDK) for graphics features development.


1 Answers

you cannot get the matrix, since Android provides GLES 1.0, and not GLES 1.1 at this point, and therefor doesn't support all the various glGet* functions of 1.1.

like image 101
reflog Avatar answered Oct 06 '22 00:10

reflog