#VRML V2.0 utf8 NavigationInfo { headlight FALSE } DEF reglage Transform { rotation 0 1 0 1 children [ Shape { geometry Cylinder { } appearance Appearance { material Material { diffuseColor 0 0 .72 specularColor .5 .5 .5 emissiveColor 0 0 .13 ambientIntensity 0 } } } DEF captRG CylinderSensor { offset 1 maxAngle 6 } ] } Transform { translation 0 1.5 0 children [ Shape { geometry DEF affichage Text { string "1" } } ] } DEF lamp PointLight { on FALSE color 1 1 1 location 4 1 10 } DEF Timer TimeSensor { } Transform { translation 2 0 0 children [ Shape { geometry Box { size .2 .2 .2 } } DEF interupteur TouchSensor { } ] } DEF convert Script { eventIn SFRotation rot eventIn SFTime touch field SFBool etat FALSE eventOut MFString duree eventOut SFTime temps eventOut SFBool active url "javascript: function rot(val){ temps = duree[0] = Math.floor(100*val[3])/100 ; } function touch(){ etat = !etat ; if (etat) active = etat ; } " } ROUTE captRG.rotation_changed TO reglage.rotation ROUTE captRG.rotation_changed TO convert.rot ROUTE convert.duree TO affichage.string ROUTE convert.temps TO Timer.cycleInterval ROUTE interupteur.touchTime TO Timer.startTime ROUTE Timer.isActive TO lamp.on ROUTE Timer.cycleTime TO convert.touch ROUTE convert.active TO lamp.on