H3D::Fog Class Reference
[X3D node classes.]

The Fog node provides a way to simulate atmospheric effects by blending objects with the colour specified by the color field based on the distances of the various objects from the viewer. More...

#include <H3D/Fog.h>

Inheritance diagram for H3D::Fog:

Inheritance graph

List of all members.

Public Member Functions

 Fog (Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0, Inst< SFColor > _color=0, Inst< SFString > _fogType=0, Inst< SFFloat > _visibilityRange=0)
 Construtor.
virtual void renderFog ()
 Render the global fog with OpenGL.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.

Static Public Member Functions

static FoggetActive ()
 Convenience function to get the top of the Fog stack.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

H3DFloat scale_local_to_global
 The scaling factor from local to global space.


Detailed Description

The Fog node provides a way to simulate atmospheric effects by blending objects with the colour specified by the color field based on the distances of the various objects from the viewer.

The distances are calculated in the coordinate space of the Fog node. The visibilityRange specifies the distance in metres (in the local coordinate system) at which objects are totally obscured by the fog. Objects located outside the visibilityRange from the viewer are drawn with a constant colour of color. Objects very close to the viewer are blended very little with the fog color. A visibilityRange of 0.0 disables the Fog node. The visibilityRange is affected by the scaling transformations of the Fog node's parents; translations and rotations have no affect on visibilityRange.

The fogType field controls how much of the fog colour is blended with the object as a function of distance. If fogType is "LINEAR", the amount of blending is a linear function of the distance, resulting in a depth cueing effect. If fogType is "EXPONENTIAL," an exponential increase in blending is used, resulting in a more natural fog appearance.


Member Function Documentation

virtual void H3D::Fog::traverseSG ( TraverseInfo ti  )  [inline, virtual]

Traverse the scenegraph.

Set the scale_local_to_global variable.

Parameters:
ti The TraverseInfo object containing information about the traversal.

Reimplemented from H3D::Node.

References H3D::TraverseInfo::getAccForwardMatrix().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:30:07 2008 for H3D API by  doxygen 1.5.7