, . , OpenGL Android. , , 4 ?
"". this .
, "" .
:
, (x1, y1, z1). (Ox, Oy, Oz).
Set Origin:
Matrix.setIdentityM(mModelMatrix, 0);
, :
Matrix.translateM(mModelMatrix, 0, -x1, -y1, -z1);
Matrix.rotateM(mModelMatrix, 0, rotationAngle, 0.0f, 0.0f, 1.0f);
:
Matrix.translateM(mModelMatrix, 0, x1, y1, z1);
, :
Matrix.translateM(mModelMatrix, 0, x, y, z);
.
Try:
Set Origin:
Matrix.setIdentityM(mModelMatrix, 0);
:
Matrix.translateM(mModelMatrix, 0, x, y, z);
Matrix.translateM(mModelMatrix, 0, x1, y1, z1);
Matrix.rotateM(mModelMatrix, 0, rotationAngle, 0.0f, 0.0f, 1.0f);
Matrix.translateM(mModelMatrix, 0, -x1, -y1, -z1);
, .
Edit
, , : :
Matrix.setIdentityM(mModelMatrix, 0);
Matrix.translateM(mModelMatrix, 0, x1, y1, z1);
Matrix.rotateM(mModelMatrix, 0, rotationAngle, 0.0f, 0.0f, 1.0f);
Matrix.Multiply(mViewProjection, 0, mProjection, 0, mCameraView, 0);
mViewProjection * mModelMatrix * a_Position;
?
/ ( ) . , , -