   How to make a rolling texture?
  Hi all,I'm new to openGL and I had been trying to do a rolling texture on a single object. However I had few problems with it.I've been trying this code://global variablefloat roll = 0;void renderScene(){...glMatrixMode(GL_TEXTURE);glTranslatef(roll, 0.0f, 0.0f);glMatrixMode(GL_MODELVIEW);renderTerrain();renderSky();renderModels();...}void idle(){...roll+=0.0002f;if(roll > 1)roll = 0;...}What happens is that the texture is moving, but it accelerates :(All my other texture are moving too, which is not what I want >_>I tried modifiying the texture coordinates too. It works for a plane but for a model, the texture movement speed accelerates too..Anyone know what am I doing wrong here?   
  The texture will accelerate because you adding larger and larger values roll+=0.0002. You can clamp this value to an abitrary value and then reset roll and start the count again(much like use modulus arithmetic. The fact that all you textures are scrolling is due to the fact that the texture matrix will be applied to all textures use afterward. To prevent this only modify the texture matrix when using the texture you want to scroll and then reset it to the identity matrix for all other non scrolling textures. I hope this helps.   ;  Your rolling code seems to be fine, since I guess roll is not the speed but the translation offset.Your problems both originate from the same source: you don't use the matrix stack.Imagine the following example:frame 1roll = 0.0002 -> textures are translated by 0.0002frame 2 roll = 0.0004 -> textures are translated by 0.0002 + 0.0004 = 0.0006frame 3roll = 0.0006 -> textures are translated by 0.0002 + 0.0004 + 0.0006 = 0.0012etc.Now, to solve this, use something similar to that://set up your modelview matrix hererenderTerrain();glMatrixMode(GL_TEXTURE);glPushMatrix(); //save the current state of the texture matrixglTranslatef(roll, 0.0f, 0.0f); //change the texture matrixglMatrixMode(GL_MODELVIEW);renderSky(); //assuming you only want to roll the sky textureglMatrixMode(GL_TEXTURE);glPopMatrix(); //restore the saved texture matrixglMatrixMode(GL_MODELVIEW);renderModels();This will cause the roll offset to be 0.0002, 0.0004, 0.0006 etc. for frames 1, 2, 3, etc.AND it will only cause the sky texture (or better: all textures between the glPush/PopMatrix() pair) to roll.   ;  yay it works!Thanks all :D   