Understanding how fog owrks

Hi

I’m tryng to implement some fog in my world, but i’m getting strange results.
When i’m standing in the middle of the fog, he behaves weirdly, like if it disapears when i rotate the camera in some ways.
How is the Startfog,Endfog works ?
Is it in relation to the camera position, or in relation the the polygon that i’m drawing?

thanks

Bruno

It sounds like you are transforming the projection matrix to change the view. You should pretty much leave the projection matrix alone once you have it set (except if you are doing variable fov). Do all translations and rotations on the modelview matrix. Fog uses eye space, not world space, as I understand it.

[This message has been edited by DFrey (edited 01-19-2001).]

There’s also the problem that fog is calculated with distance from the near plane, which results is smaller distance at the edges of the screen than in the center for the same object. There is a nVidia extension which fixes that.