Vizard 7 » Command Index » Vizard objects » scene » <scene>.fog
7.7

<scene>.fog

Turns on fog

<scene>.fog(  
start/density  
end = -1  
)  
start/density
The start distance of the fog or the density, depending on the value of end.
end = -1
If a value is specified then this represents the end distance for fog. If no value is specified then the exponential fog is used.

Remarks

The fog equations used depend on the parameters supplied. If a start and end values are given, then linear fogging is enabled in which no fog appears before start distance from the observer and 100% density is reached at end distance from the observer. If only a density is given, then an exponential dropoff function is used (OpenGL's GL_EXP) that's continuous from 0 to infinity.

Return Value

None

Example

#Set fog color to gray
viz.Scene1.fogColor(0.5,0.5,0.5)

#Use linear fog that start from 1 meter in front of the user and end at 10 meters in front of the user
viz.Scene1.fog(1,10)

#Use exponential fog

viz.Scene1.fog(0.2)