PDA

View Full Version : Move FOG



thoean
06-11-2003, 07:14 AM
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, SKYSIZE*0.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

Bob
06-11-2003, 08:29 AM
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.

thoean
06-11-2003, 01:56 PM
thank you, it's working now...
i did the camera transformations in the projection matrix...

thoean

peter.vullings
06-12-2003, 04:38 PM
good call bob!

goru
07-02-2003, 10:40 AM
Originally posted by thoean:
thank you, it's working now...
i did the camera transformations in the projection matrix...

thoean

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