开发者

getting model view matrix in Android?

how to get current model view matrix in Android?i am using OpenGL 1.1,the method GL.getFloatv() is giving zero values.please help.

float[] model_matrix = new float[16];
GL11.getFloatv(GL11.GL_MODELVIEW_MATRIX,model_matri开发者_StackOverflowx);


Just a guess, since you don't show any code: you should be using GL11.GL_MODELVIEW_MATRIX, and not GL_MODELVIEW for requesting the matrix values.


Not sure if this is still pending or which version you used, but as of now, the GLES11.glGetFloatv has 2 overloads and the the one using float[16] requires 3 parameters. The one with 2 params takes a FloatBuffer. This works for me:

float[] model_matrix = new float[16];
GLES11.glGetFloatv(GLES11.GL_MODELVIEW_MATRIX, model_matrix, 0);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜