I'm normal mapping an object that has a static light source (the sun). However, this object rotates freely.

My dot3 calculation works for dynamic light movement with static object, but not the other way around.

I only need to always keep the vertex colors so the sun light vector is kept. therefore the object will look "correctly" lit.

I almost got the solution, but its more of a hack than a good method. And it doesn't look as good.

Can anyone explain me what should I be looking for on my maths book?. Thanks. Any pseudo code representing a solution for this problem will be loved.