PDA

View Full Version : gl_fog



shoot
10-25-2000, 08:33 AM
Hi...
I'm using GL_FOG in an 3d terrain engine, but it seem only to work in the Z axis...
That is, I have the desired fog effect in the Z axis, but when the camera rotates to the X axis, the fog effect gradually decrement..., then when I turn the camera to the Z axis, it works again
what happens? Any idea to solve it?

Thanks!!

Bob
10-25-2000, 08:45 AM
A wild guess. Are you doing your rotation in the projection matrix? If so, shame on you, you should do it in the modelview matrix.

shoot
10-25-2000, 08:57 AM
no,
now I'm using glLookAt()...

Eric
10-25-2000, 09:37 PM
gluLookAt multiplies the CURRENT matrix with another one... Which matrix is current when you call it ???

Is it the PROJECTION_MATRIX or the MODELVIEW_MATRIX ???

If first case, then switch to the second !

Regards.

Eric

newt
10-26-2000, 05:46 AM
What is the terrain ?

Very large polygons ?

Some cards do not do per-pixel fog and only interpolate through the fog applied at each vertex. Rotating through 90 degrees could be badly affecting how this works.