I was under the impression that gl.glTranslatef() effectively moved a sprite by the values passed in to the method (ie if I wanted a sprite to move by 2 pixels I would call gl.glTranslate(2.0f,0.0f,0.0f);
However If I do this then the sprite remains static. However If I pass in an absolute position (ie call gl.glTranslatef(52.0f,0.0f,0.0f)) my sprite moves as expected. However its starting position is out by the initial position coordinates (ie If I specify the sprite to start at 30,30 then the first draw loop draws the sprite at 62,30, once the first frame is done the sprite moves as I expect.
What is going on?
here is the draw code for my sprite.
//Reset the modelview matrix
//bind the previously generated texture
//point to our buffers
//set the face rotation
gl.glTranslatef(_position.x,_position.y,0.0f);//need to work out fraction of 1 that the position of the sprite represents
//point to our vertex buffer
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, _vertexBuffer);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, _textureBuffer);
//draw the vertices as a triangle strip
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, _vertices.length / 3);
//disable the client state before leaving
Note that this passes in the absolute position and not the small extra movement.