PDA

View Full Version : playing around with the TEXTURE MATRIX



Acid-Chris
03-31-2002, 01:04 AM
Hello!

here is my problem:
i render a simple cube with some textures on it to see something on screen. now i want to scroll ONE texture. i change to the TEXTURE matrix, do my translation and switch back to the MODELVIEW matrix. but all i get is that all textures scroll... http://www.opengl.org/discussion_boards/ubb/frown.gif
and i dont know why.

(for better understanding, here is a piece of pseudo code)
Vid_Render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
...

RenderShader();
}


RenderShader()
{
struct stShaderBase *p = (structstShaderBase *)pShaderTable[iID].pData;
...
if (p->bScroll)
{
glMatrixMode(GL_TEXTURE);
glTranslatef(p->fXMove, 0.0f, 0.0f);
glMatrixMode(GL_MODELVIEW);
}
}

hope you can help me.
regards, and happy easter!
- Christoph -

zed
03-31-2002, 01:36 AM
after youre finished + just before u leave the texturematrix do a glLoadIdentity()