Debian Codegraph @

models/vrml97/script/simple-boolean.wrl

raw
1 #VRML V2.0 utf8
2
3 Group {
4 children [
5 Transform {
6 children [
7 DEF light PointLight {
8 intensity 1
9 on FALSE
10 }
11
12 Transform {
13 translation -2 0 -2
14 children [
15 Shape {
16 appearance Appearance {
17 material Material {
18 diffuseColor 1 0 1
19 specularColor 1 1 1
20 shininess 0.9
21 }
22 }
23 geometry Sphere { }
24 }
25 DEF touchsensor TouchSensor { }
26 ]
27 }
28 ]
29 }
30
31 DEF illuminator Script {
32 eventIn SFBool turn_on
33 eventOut SFBool light_changed
34 url [ "javascript:
35 function turn_on (value) {
36 if (value) {
37 light_changed = true;
38 }
39 else {
40 light_changed = false;
41 }
42 } " ]
43 }
44 ]
45
46 ROUTE touchsensor.isActive TO illuminator.turn_on
47 ROUTE illuminator.light_changed TO light.set_on
48 }