VRML: Animation



Transform {
   translation -4 0 0
   children [
      DEF PUSH TouchSensor { }
      Shape {
	 appearance Appearance {
	    material Material {
	       diffuseColor 1 1 0
	    }
	 }
	 geometry Sphere {}
      }
     ]
}
Sound { source DEF BOOM AudioClip { url [ "boom.wav" ] } }
ROUTE PUSH.touchTime TO BOOM.startTime

######################################################################

Transform {
   translation 0 0 0
   children [
      DEF PUSH2 TouchSensor { }
      Shape {
	 appearance Appearance {
	    material DEF MAT Material {
	       diffuseColor 1 0 0
	       transparency 0
	    }
	 }
	 geometry Cylinder {}
      }
     ]
}
DEF TIMER TimeSensor { cycleInterval 3 }
ROUTE PUSH2.touchTime TO TIMER.startTime
ROUTE TIMER.fraction_changed TO MAT.transparency

######################################################################

DEF SPINNER Transform {
   translation 4 0 0
   rotation 0 0 1  0
   children [
      DEF PUSH3 TouchSensor { }
      Shape {
	 appearance Appearance {
	    material Material {
	       diffuseColor 0 0 1
	    }
	 }
	 geometry Cone {}
      }
     ]
}
DEF TIMER2 TimeSensor { cycleInterval 3 }
DEF CHANGER OrientationInterpolator {
   key [ 0, 0.5, 1 ]
   keyValue [ 0 0 1  0,
	      0 0 1  3.14,
	      0 0 1  6.28 ]
}
ROUTE PUSH3.touchTime TO TIMER2.startTime
ROUTE TIMER2.fraction_changed TO CHANGER.set_fraction
ROUTE CHANGER.value_changed TO SPINNER.rotation





  


mrl