0

我是 android 中的 openGlEs 新手。我尝试了这里提到的教程http://developer.android.com/training/graphics/opengl/index.html

我正在尝试旋转我绘制的正方形。但是注意到发生了。这是我的代码片段

@Override
    public void onDrawFrame(GL10 gl)
    { 
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);

        Matrix.setRotateM(mRotationMatrix, 0, 45, 0, 0, 1.0f);
        Matrix.multiplyMM(mMVPMatrix, 0, mVMatrix, 0, mRotationMatrix, 0);
        Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mMVPMatrix, 0);

        square.draw(mMVPMatrix);
    }

即使没有 Matrix.methods 我也可以画一个正方形。我不确定这里发生了什么。请建议我一个解决方案。如果有人分享有关此的链接,那将非常有帮助

4

1 回答 1

0

把 Matrix.setIdentityM(mRotationMatrix, 0); 在设置旋转之前。

于 2013-09-05T19:18:22.103 回答