Class dnx.lr.node.FogNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.FogNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.LeafNode
                           |
                           +----dnx.lr.BindableNode
                                   |
                                   +----dnx.lr.node.FogNode

public class FogNode
extends BindableNode
 Fog {
    exposedField SFColor      color           1 1 1
    exposedField SFString     fogType         "LINEAR"
    exposedField SFFloat      visibilityRange 0
    eventIn      SFBool       set_bind        
    eventOut     SFBool       isBound         
 }

The Fog node provides a way to simulate atmospheric effects by blending objects with the color specified by the color field based on the objects' distances from the viewer. The distances are calculated in the coordinate space of the Fog node. The visibilityRange specifies the distance (in the Fog node's coordinate space) at which objects are totally obscured by the fog. Objects located visibilityRange meters or more away from the viewer are drawn with a constant color of color. Objects very close to the viewer are blended very little with the fog color. A visibilityRange of 0.0 or less disables the Fog node. Note that visibilityRange is affected by the scaling transformations of the Fog node's parents - translations and rotations have no affect on visibilityRange.

Fog nodes are "Concepts - Bindable Children Nodes" and thus there exists a Fog stack, in which the top-most Fog node on the stack is currently active. To push a Fog node onto the top of the stack, a TRUE value is sent to the set_bind eventIn. Once active, the Fog is then bound to the browsers view. A FALSE value of set_bind, pops the Fog from the stack and unbinds it from the browser viewer. See "Concepts - Bindable Children Nodes" for more details on the the Fog stack.

The fogType field controls how much of the fog color is blended with the object as a function of distance. If fogType is "LINEAR" (the default), then the amount of blending is a linear function of the distance, resulting in a depth cuing effect. If fogType is "EXPONENTIAL" then an exponential increase in blending should be used, resulting in a more natural fog appearance.

For best visual results, the Background node (which is unaffected by the Fog node) should be the same color as the fog node. The Fog node can also be used in conjunction with the visibilityLimit field of NavigationInfo node to provide a smooth fade out of objects as they approach the far clipping plane.

See the section "Concepts - Lighting Model" for details on lighting calculations.


Variable Index

 o color
 o fogType
 o isBound
 o visibilityRange

Constructor Index

 o FogNode()

Method Index

 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getFog()
 o handleEvent(SceneEvent)
Handle an event.
 o handleFieldChange(Field)
Handle a field change.
 o initFields()
Initialize field values.
 o postIsBoundEvent()
 o postIsUnboundEvent()

Variables

 o color
  public SFColor color
 o fogType
  public SFString fogType
 o visibilityRange
  public SFFloat visibilityRange
 o isBound
  public SFBool isBound

Constructors

 o FogNode
  public FogNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o getFog
  public Fog getFog()
 o handleFieldChange
  protected void handleFieldChange(Field f)
Handle a field change.
Overrides:
handleFieldChange in class Node
 o handleEvent
  protected void handleEvent(SceneEvent ev)
Handle an event.
Overrides:
handleEvent in class Node
 o postIsBoundEvent
  public void postIsBoundEvent()
Overrides:
postIsBoundEvent in class BindableNode
 o postIsUnboundEvent
  public void postIsUnboundEvent()
Overrides:
postIsUnboundEvent in class BindableNode

All Packages  Class Hierarchy  This Package  Previous  Next  Index