d4rwins

05-21-2015, 03:46 AM

I am trying to implement a sprite of 8 columns and 8 rows in OpenGL ES 2.0

I made appear the first imagen but I cant figure out how to translate the Texture matrix in OpenGL ES 2.0 , the equivalent of the code in OpenGL 1.0 that I am looking is

gl.glMatrixMode(GL10.GL_TEXTURE);

gl.glLoadIdentity();

gl.glPushMatrix();

gl.glTranslatef(0.0f, 0.2f, 0f);

gl.glPopMatrix();

This are the matrix that I am using atm

/**

* Store the model matrix. This matrix is used to move models from object space (where each model can be thought

* of being located at the center of the universe) to world space.

*/

private float[] mModelMatrix = new float[16];

/**

* Store the view matrix. This can be thought of as our camera. This matrix transforms world space to eye space;

* it positions things relative to our eye.

*/

private float[] mViewMatrix = new float[16];

/** Store the projection matrix. This is used to project the scene onto a 2D viewport. */

private float[] mProjectionMatrix = new float[16];

/** Allocate storage for the final combined matrix. This will be passed into the shader program. */

private float[] mMVPMatrix = new float[16];

/**

* Stores a copy of the model matrix specifically for the light position.

*/

private float[] mLightModelMatrix = new float[16];

I made appear the first imagen but I cant figure out how to translate the Texture matrix in OpenGL ES 2.0 , the equivalent of the code in OpenGL 1.0 that I am looking is

gl.glMatrixMode(GL10.GL_TEXTURE);

gl.glLoadIdentity();

gl.glPushMatrix();

gl.glTranslatef(0.0f, 0.2f, 0f);

gl.glPopMatrix();

This are the matrix that I am using atm

/**

* Store the model matrix. This matrix is used to move models from object space (where each model can be thought

* of being located at the center of the universe) to world space.

*/

private float[] mModelMatrix = new float[16];

/**

* Store the view matrix. This can be thought of as our camera. This matrix transforms world space to eye space;

* it positions things relative to our eye.

*/

private float[] mViewMatrix = new float[16];

/** Store the projection matrix. This is used to project the scene onto a 2D viewport. */

private float[] mProjectionMatrix = new float[16];

/** Allocate storage for the final combined matrix. This will be passed into the shader program. */

private float[] mMVPMatrix = new float[16];

/**

* Stores a copy of the model matrix specifically for the light position.

*/

private float[] mLightModelMatrix = new float[16];