#VRML V2.0 utf8 # #
# [return] #

# ex-fog.wrl
# when sphere is touched fog is enabled changing the sphere's color
# 

Viewpoint { position 0 0 50}

# Fog node initialization (False)
DEF T TimeSensor {
     stopTime 1
                  }

# Fog definition
DEF F Fog {
       color 0 1 0
       fogType "LINEAR"
       visibilityRange 10
#       set_bind 
           }
Transform {
     children [
         Shape {
            geometry Text {
                          string ["touch sphere once!"]
                          length [17]
                          maxExtent 17
                           }
                }
                ]
            }
# Sensor
Transform{
    translation -4 8 0
         children [
               Shape{
                   geometry Sphere{radius 4.}
                   appearance Appearance{
                               material Material{
                               diffuseColor .73 .56 .56}
                                         }
                     }
                DEF STOUCH TouchSensor{}
                   ]
          }


ROUTE T.isActive TO F.set_bind        # send FALSE at begin
ROUTE STOUCH.isActive TO F.set_bind   # send TRUE once when touch

#