I have and interesting problem I hope someone can help me out with. I am rendering a river scene with animated water. The problem is that when I move the water along in the river, the lighting on the water seems to stay in the same place as it was when the scene started out. Does anybody know what might be going on?
Dunno, maybe forgot to animate the normals?
Right, let’s play 20 questions…
Are you using standard opengl lighting? (not any fancy per-pixel stuff? no per-pixel reflections? basically, nothing advanced?
If the answer is yes, then go to the beginners forum and post your question there. http://www.opengl.org/discussion_boards/…e=20&LastLogin=
You need to position your light at the correct time in relation to your modelview matrix operations.
If the light is in the ‘world’ then you need to position it with the glLight call right after you move the eye (inverse viewing on the modelview stack).
If the light is following the water then it is likely that you position the light after you apply the matrix to position the water, or you are making a similar mistake.