Hi,
glgetdoublev is omitted from OGL ES. How can i immitate its usage??
i would like to get the projection and modelview matrices.
best
Fad
Printable View
Hi,
glgetdoublev is omitted from OGL ES. How can i immitate its usage??
i would like to get the projection and modelview matrices.
best
Fad
Use glGetFloatv.
But is that available in ES 1.0?? I now it is in ES1.1 only!!
In OpenGL ES 1.0 you have to use the OES_query_matrix extension.
Code :
// global scope typedef GLbitfield (APIENTRY * PFNGLQUERYMATRIXXOES) (GLfixed mantissa[16], GLint exponent[16]); PFNGLQUERYMATRIXXOES glQueryMatrixxOES; // your init function // before this, make sure that "OES_query_matrix" is part of the extension string glQueryMatrixxOES = (PFNGLQUERYMATRIXXOES) eglGetProcAddress("glQueryMatrixxOES"); // where you want to use it glMatrixMode(GL_MODELVIEW); GLfixed mantissa[16]; GLint exponent[16]; GLbitfield validcomponents = glQueryMatrixxOES(mantissa, exponent);
THANX XMAS
Hi (Xmas),
I managed to apply the code you provided me. However, the results in mantisa are too large fixed values (tens of thousends when shifted to integers). what do these values really mean?? an what is the need for epxonent in this case??
cheers
I managed to find a way to get the exact value of the matrix fields. correct me if i am wrong:
matrix[i] = mantisa[i]*2^exponent[i]
Cheers
That is correct. The reason for the separate mantissa and exponent was to enable this extension to return both fixed point and floating point internal representations accurately.
Hi,
I have posted this tread long time ago and i found it useful. However now i am facing a limitation with the usage of the method to retreive the projection and model-view matices.
the code below suggests querying the matrix needed just after loading it:
in this case i will be able to query the GL_PROJECTION matrix only once in the init function as it is loaded only then.Quote:
Code :
// global scope typedef GLbitfield (APIENTRY * PFNGLQUERYMATRIXXOES) (GLfixed mantissa[16], GLint exponent[16]); PFNGLQUERYMATRIXXOES glQueryMatrixxOES; // your init function // before this, make sure that "OES_query_matrix" is part of the extension string glQueryMatrixxOES = (PFNGLQUERYMATRIXXOES) eglGetProcAddress("glQueryMatrixxOES"); // where you want to use it glMatrixMode(GL_MODELVIEW); GLfixed mantissa[16]; GLint exponent[16]; GLbitfield validcomponents = glQueryMatrixxOES(mantissa, exponent);
How can i query it at any time in the code?
thanx
Fadi
I don't see where it suggests that. Once you have initialized the function pointer you can use glQueryMatrixxOES anywhere (provided it is declared at global scope).Quote:
Originally Posted by Fadi Chehimi
But again, please check that "OES_query_matrix" can be found in the extension string (and that the pointer returned by eglGetProcAddress is not NULL) before you use the extension.