Scaling & offsetting textures

Hi All,

Scaling and offsetting textures is very easy like below:

glTexCoord2d(offsetX + scaleX * U, offsetY + scaleY * V);

Is there a way to specify a scale and offset somewhere else and leave the glTexCoord2d() call like below:

glTexCoord2d(U, V);

so we don’t need to recompile the object every time the user changes the texture scale?

Thanks,

Alberto

You can do that on the texture matrix.

Texture matrix, I’ve never heard about it. Where can I learn more?

Thanks,

Alberto

http://glprogramming.com/red/chapter09.html#name17

Ah, do you mean?

glMatrixMode(GL_TEXTURE); /* enter texture matrix mode */
glScaled(...); 
glRotated(...);

Thanks,

Alberto

yes.