Translate Texture u/v

hello,

i would like to know if its possible
to translate u/v positions of textures.

for simple example
i call an complied object(triangle)
that got uv’s: 0.5f,0.0f 0.0f,1.0f 1.0f,1.0f

and i want to translate the u ord v coordinate for
example: u +0.1f and v +0.0

so that i get : 0.6f,0.0f 0.1f,1.0f 1.1f,1.0f
without create and compile the object again

is it possible and what did i need to do?

What you want are texture coordinate matrices. The texture matrix stack is just another transform stack in OpenGL (like the ModelView and Projection). The texture transform modifies all of the texture coordinates before they’re actually used in the texture.

For your example:


// adjust the texture transform
gl.glMatrixMode(GL.GL_TEXTURE);
gl.glLoadIdentity();
gl.glTranslatef(.1f, 0f, 0f);

gl.glMatrixMode(GL.GL_MODELVIEW);

.. call the display list or render normally

ahhh, i understand…

thats perfect and easy :slight_smile:

much much thanks to you for your help

thk, cool I was looking for that too