I''ve recently been pondering the best way to go about making a water effect, im a total novice at opengl, and I was just wondering if anyone had any thoughts on how to go about coding such a thing. Think of the water in quake1, It doesnt flow, it just seems to morph the texture around. Any ideas would be greatly apreciated.
// reset the texture matrix or stuff will be screwed up glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW);
angle += 0.0005f; rotate += 0.01f; }
Now the texture on the cube will look like it''s flowing to the southeast and will be going slowly counter clockwise. Basically what you''re doing when you set the matrix stack to GL_TEXTURE, is telling OpenGL to do these things to all the textures. So, if you don''t reset the texture matrix then it will do the stuff you told it to do to all the other textures. Like I said, I''m a bit rusty on this subject but that''s what I think is happening. Try looking for tutorials on the matrix stack if you want a better explanation. Hope this helped.