#VRML V2.0 utf8 DEF increaseSwitch Script { eventIn SFBool bool_in eventOut SFInt32 choice_out field SFInt32 currentValue -1 field SFInt32 maxValue 3 url [ "javascript: // field SFInt32 currentValue // // field SFInt32 maxValue // // eventOut SFInt32 choice_out // function bool_in(value) { // value SFBool if (value) if (currentValue < maxValue) { currentValue++; choice_out = currentValue; } } " ] } DEF oneshot1 Script { eventIn SFBool bool_in eventOut SFBool bool_out field SFBool intern FALSE url [ "javascript: // eventOut SFBool bool_out // // field SFBool intern // function bool_in(value) { // value SFBool if (value) if (!intern) { intern = true; bool_out = true; } } " ] } ROUTE oneshot1.bool_out TO increaseSwitch.bool_in DEF oneshot2 Script { eventIn SFBool bool_in eventOut SFBool bool_out field SFBool intern FALSE url [ "javascript: // eventOut SFBool bool_out // // field SFBool intern // function bool_in(value) { // value SFBool if (value) if (!intern) { intern = true; bool_out = true; } } " ] } ROUTE oneshot2.bool_out TO increaseSwitch.bool_in DEF oneshot3 Script { eventIn SFBool bool_in eventOut SFBool bool_out field SFBool intern FALSE url [ "javascript: // eventOut SFBool bool_out // // field SFBool intern // function bool_in(value) { // value SFBool if (value) if (!intern) { intern = true; bool_out = true; } } " ] } ROUTE oneshot3.bool_out TO increaseSwitch.bool_in Viewpoint { } Transform { children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 emissiveColor 1 0 0 shininess 7.812500e-2 specularColor 0.500000 0.500000 0.500000 } } geometry IndexedLineSet { coord Coordinate { point [ -2 -2 -2 -2 2 -2 2 2 -2 2 -2 -2 -2 -2 2 -2 2 2 2 2 2 2 -2 2 ] } coordIndex [ 0 1 2 3 0 -1 6 7 3 2 6 -1 7 6 5 4 7 -1 4 5 1 0 4 -1 1 5 6 2 1 -1 4 0 3 7 4 -1 ] } } DEF ProximitySensor1 ProximitySensor { size 4 4 4 } Transform { children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Text { string [ "Proximity" ] } } ] translation -2 -3.549376 0 } ] translation 0 0 3.355746 } ROUTE ProximitySensor1.isActive TO oneshot1.bool_in Transform { children [ Shape { appearance Appearance { material Material { } } geometry Sphere { radius 0.360000 } } DEF TouchSensor2 TouchSensor { } ] translation -3.964205 0 0 } ROUTE TouchSensor2.isActive TO oneshot2.bool_in Transform { children [ Shape { appearance Appearance { material Material { } } geometry Sphere { radius 0.360000 } } DEF TouchSensor1 TouchSensor { } ] translation 3.785829 0 0 } ROUTE TouchSensor1.isActive TO oneshot3.bool_in DEF Switch1 Switch { choice [ Transform { children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] } Transform { children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] } Transform { children [ Shape { appearance Appearance { material Material { } } geometry Cone { } } ] } Transform { children [ Shape { appearance Appearance { material Material { } } geometry Box { } } ] } ] } ROUTE increaseSwitch.choice_out TO Switch1.set_whichChoice