Move FOG

i move my camera, but the fog does not move, so when i move the camera about 50 units, then i am fully in the fog.

how can I solve it, that the fog is moving with my camera eye?

my settings for the fog are:

GLfloat fogColor[4] = {1.0, 1.0, 1.0, 1.0};
glEnable(GL_FOG);
glFogf(GL_FOG_START, SKYSIZE0.4f);
glFogf(GL_FOG_END, SKYSIZE
0.5f);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fogColor);
glFogf(GL_FOG_DENSITY, 0.35);
glHint(GL_FOG_HINT, GL_NICEST);

thx for any help

I bet you do the viewpoint transform in the projection matrix. Always do it in the modelview matrix unless you know what you’re doing.

thank you, it’s working now…
i did the camera transformations in the projection matrix…

thoean

good call bob!

Originally posted by thoean:
[b]thank you, it’s working now…
i did the camera transformations in the projection matrix…

thoean[/b]

hey hi ,
I am having a kind a same problem ,
when i was using the GL_PROJECTION
i could change the desnity of fog
by changing its modes but i cant remove
the fog by changing the camera angle
and after reading your message i tried
GL_MODELVIEW instead of GL_PROJECTION
but now nothing comes on the screen can u helo me in that

Thankx