#VRML V2.0 utf8

WorldInfo {
  title "Prims"
}

Background {
   skyColor [ 0.4 0.4 0.4,
          0.6 0.6 0.6 ]
}

Viewpoint {
   position 0 0 8
   orientation 0 1 0 0
}

NavigationInfo {
   type "WALK"
   speed 5
}

Transform {
   translation 0 0 -8
   children [
      DEF SPHERE_TRANSFORM Transform {
     children [
        Shape {
           appearance Appearance {
          material DEF SPHERE_MAT Material {
             diffuseColor 0.1 0.5 0.2
             specularColor 0.8 0.8 0.8
             shininess 0.25
          }
           }
           geometry Sphere {
          radius 1.1
           }
        }
       ]
      }

      Transform {
     translation 3 0 0
     children [
        Shape {
           appearance Appearance {
          material DEF RED Material {
             diffuseColor 0.7 0.1 0.1
          }
           }
           geometry Box {
          size 1.5 1.5 1.5
           }
        }
       ]
      }

      Transform {
     translation -3 0 0
     children [
        Shape {
           appearance Appearance {
          material DEF CONE_MAT Material {
             diffuseColor 0.2 0.7 0.8
             specularColor 1 1 1
             shininess 0.4
          }
           }
           geometry Cone {}
        }
       ]
      }
     ]
}

DEF TIMER TimeSensor {
   loop TRUE
   cycleInterval 4
}

DEF INTERPOLATOR ColorInterpolator {
   keys [ 0, 0.25, 0.5, 0.75, 1 ]
   values [ 1 0 0, 0 1 0, 0 0 1, 0 1 0, 1 0 0 ]
}

DEF OPACITY_INTERPOLATOR ScalarInterpolator {
   keys [ 0, 0.5, 1 ]
   values [ 0, 1, 0 ]
}

Group {
   # See if routes work when declared inside of a node
   ROUTE TIMER.fraction TO INTERPOLATOR.set_fraction
   ROUTE INTERPOLATOR.value_changed TO SPHERE_MAT.set_diffuseColor
   ROUTE TIMER.fraction TO OPACITY_INTERPOLATOR.set_fraction
   ROUTE OPACITY_INTERPOLATOR.value_changed TO CONE_MAT.set_transparency
}