I am new with OpenGL (~two months) ; I have a question concerning how lighting works, and more specifically, why I have a problem. I'll probably tell more than is needed, but I have no idea what is going wrong, so more is better than too little...
I have set up an openGL (no shaders, limited to ES) framework. Within that framework, I have been playing with a limited view of the solar system.
I have the sun (which contains a light in the center, which is not situated at the infinite), the earth (textured, orbiting and rotating on itself) and the moon (textured, orbiting around the earth.) I could add more, but that's not the point yet.
I have a standard viewing point, situated somewhere outside the solar system. I can view and rotate the planetary system and all looks OK, including lighting (i.e. I see that there is a dark side for earth, and that all places on earth (except the poles) get nights and days.
I can also positon my view point on the earth or on the moon (I did not really experiment much with the moon though), locally immobile ; from this view, I can change my viewing angles so that I can pretty much see everything there is to see from the ground. So I can see the sun (or moon) set up or down, or follow them in the sky. The earth texture is quite bad at that range (due to pixellation), but that could likely be solved with mipmapping later.
However, in that view, there is something that's not happening : I do not experiment the passing of night and days which I can see from outer space. There is no question that the model is the same (only the view position changes.) ; in case you wonder, I do reset the light position each frame, when I actually draw the sun.
Also, but this is more subjective, I feel the the moon is not correctly receiving light too when I am in that view point.
So my question is : what is going on, and why would lighting fail when my view point is on the planet rather that outer space...
Thanks for any answer!