Thursday, 5 September 2013

Rotating a view in openGLES android

Rotating a view in openGLES android

I am new to openGlEs in android. I tried out the tutorial mentioned here
http://developer.android.com/training/graphics/opengl/index.html
I am trying to rotate the square I have drawn. But noting happens. Here is
my code snippet
@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);
}
I can draw a square even without Matrix.methods . I am not sure what is
happening here. Please suggest me a solution. It would be very helpful if
anyone share links regarding this

No comments:

Post a Comment