I need to find the ModelView matrix of a current 3d object. Every method I found uses C and those functions do not exist in Java. Anyone knows how to find it in Java for android.
You do it more or less the same way you'd do it in C, and those functions do exist in Java, but the device you're using has to support GL ES 1.1 (you can specify this as the minimum version in your manifest, or check for GL ES 1.1 support at runtime).
Code:
// assuming somewhere along the lines there's a "GL11 gl" line or parameter
float[] output = new float[16];
gl.glGetFloatv(GL11.GL_MODELVIEW_MATRIX, output, 0);
Do you have anything that is written to the ModelView Matrix? Without seeing code, it is going to be impossible to accurately troubleshoot your problem.
The method that was posted above is correct. If it is returning 0's, then the MV matrix, at the point that the above code is executed, is empty.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.