The fog generated don't rotate with my scene.
When i rotate the camera, the fog is thick on the z axis, but becomes thinner when i rotate the camera away from the z axis.
(mmmhhh... i hope the explanation is clear)
Do anyone have a solution ?

Bob

10-17-2000, 02:45 AM

Well, then explanation was a tad thin, but I can try to come up with a reason. I think you are doing the transformations (glTranslate/glRotate) in the projection matrix and not the modelview matrix.

Well, what does the matrices got to do with fog you might ask. Fog is applied before the projection matrix, but after the modelview matrix. If you do translations in the projection matrix, the fog engine will recieve untransformed coordinates, and therefore might screw up fogging.

And another tip: No need to pass start and end coordinates if you use GL_EXP or GL_EXP2 fog. Nor is it necessary to pass a fog density when using linear fog.

paddy

10-17-2000, 03:51 AM

Thanks Bob, this works fine now http://www.opengl.org/discussion_boards/ubb/biggrin.gif