Fog problems

Hi,
I have experienced some strange problems with fog;
I enable it in a standard way, and all is OK when I set camera with
gluLookAt(0,dist,dist, 0,5,0, 0,1,0);

But when I change it to

gluLookAt(dist,dist,0, 0,5,0, 0,1,0);

fog is perpendicular to my camera!

It’s very well seen if you set fog color to black - you
get a black window with only a line with a background color across the middle of the window;

How to make fog respect gluLookAt?

Maybe it’s worth mentioning - I set fog parameters (range , color, etc) only once - at enabling.
.

You put the viewpoint transform (that is gluLookAt) in the modelview matrix.

Is it correct to put
gluLookAt in GL_PROJECTION matrix stack??

I welcome to my site with some screens:
www.loiv.torun.pl/~stinger

Thank You
MichalPoplawski

gluLookAt should generally be done as the first thing in the GL_MODELVIEW_MATRIX. Putting it in the GL_PROJECTION matrix can mess up fog calculations, as you’ve found out.

Now it’s fine - thank You
LordOfTheUniverse