Fog (visibility)

I have created a program which relies on visibilty being a factor within the program. The visibility is changed through a member variable m_Visibility of its class.

However, the visibility is always clearest at the origin and exponentially decays the further away from the origin the viewpoint is set. This is okay if the observer (within the program) is standing at the origin, However, the program has a capability to look at the scenario from any place. If the Viewing point is set a long way from the origin, the Visibility is bad, even if I am looking at something a very short distance away. I would like to know, how to make the visibility matrix transalate about the viewng position, so if the Visibility is set to a large number, and the View point is a very large number from the origin, the visibility will be good.

My e-mail address is

thank you very much

I don’t understand : are you asking how to make a translation matrix ? Translation by vector (a,b,c) has matrix :

1 0 0 a
0 1 0 b
0 0 1 c
0 0 0 1

I have a feeling you are doing your translation in the projection matrix. You should’t do that, unless you know for sure what will happen and that’s the result you want. Translations should go in the modelview matrix.