Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Move FOG

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    3

    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, 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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Move FOG

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    3

    Re: Move FOG

    thank you, it's working now...
    i did the camera transformations in the projection matrix...

    thoean

  4. #4
    Intern Newbie peter.vullings's Avatar
    Join Date
    Jun 2003
    Location
    New Zealand
    Posts
    34

    Re: Move FOG

    good call bob!

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    rolla
    Posts
    5

    Re: Move FOG

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •