This is supposed to render a cube. It looks like some parts of the rear faces are rendering in front of the ones closest to the camera. This happens even if I set it farther away.

I'm reading official Android OpenGL ES 2.0 tutorial, and I noticed something.

All

Using the code below my quad moves position. However, I don't want this to happen, all I'm after is for the center of rotation to move.

Does anyone have any ideas?

Note, If I place a translate function before the rotate it has no effect whatsoever.

Any help would be appreciated.

I am applying a rotation matrix to my view matrix:

float[] mTmpMatrix = new float[16];
Matrix.setLookAtM(mTmpMatrix, 0, // mViewMatrix
mCameraPosition[0], mCameraPosition[1], mCameraPosition[2], // eye
mTargetRotPosition[0], mTargetRotPosition[1], mTargetRotPosition[2],
0, 1, 0); // up
Matrix.multiplyMM(mViewMatrix, 0, mRotationMatrix, 0, mTmpMatrix

I've been wondering if anyone has some knowledge about

android.opengl.Matrix.multiplyMM

that they could share.

.

Reason for asking is, when learning through OpenGL ES, the method is widely used for all sorts of calculations. However, there is the android.renderscript.Matrix4f which I find working with more natural than with primitive float[] arrays.

I'm using this code:

Matrix matrix = new Matrix();
Bitmap bitmap = (Bitmap) BitmapFactory.decodeResource(getResources(), R.drawable.base);
matrix.setRotate(R0);
matrix.postTranslate(bitmap.getWidth()/2, bitmap.getHeight()/2);
Bitmap b = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
canvas.

I am trying to set a matrix of an image which I changed from original by zooming and panning. The new matrix value is not set when I want to show the same picture with the changed matrix.

I could get the matrix by getting the

imageView.getImageMatrix();

When I try to set it on a next view on a different activity on same image, its not changing the values.

I've used the following lines for the rotation of the object in open gl es2.
Translation and Scaling works properly, but rotation doesn't happen.

//modelViewMatrix is float[16];

Matrix.setIdentity(modelViewMatrix,0);
Matrix.translateM(modelViewMatrix, 0, x, y, z);
Matrix.rotateM(modelViewMatrix, 0, ax, 1, 0, 0);

//shader concatentation
//gl_Position = projection*modelview*position;

I tried ma

The problem is when the bitmap gets rotated "R0" degrees, it looks like if it changed the pivot point. What I want is for it to rotate around the middle of the bitmap, but I don't know how.