![]() |
Building 3D Models for the WebSimple Event and Route Examples |
These examples are from The VRML 2.0 Handbook, Addison-Wesley Developers Press.
Group {
children [
DEF LIGHT_CONTROL TouchSensor { }
Inline {
url [ "lightswitch.wrl" ] # click this to light the light
}
]
}
DEF LIGHT PointLight {
location -6 4 2
on FALSE
}
Inline { url [ "table.wrl" ] } # objects to be lit
ROUTE LIGHT_CONTROL.isActive TO LIGHT.on
Here is the light switch example in action.
Group {
children [
DEF PUSH TouchSensor { }
Inline { url [ "doorbell.wrl" ] } # doorbell geometry
]
}
Sound {
source DEF BUZZ AudioClip { url [ "doorbell.wav" ] }
maxFront 50
minFront 5
}
ROUTE PUSH.touchTime TO BUZZ.startTime
Here is the doorbell example in action.
#VRML V2.0 utf8
Viewpoint {
position 0 0 15
}
DEF DETECTOR ProximitySensor {
size 25 25 25
}
DEF TIMER TimeSensor {
cycleInterval 2
}
DEF LIGHT PointLight {
color 1 0 0
intensity 0
location 3 3 3
}
Inline {
url [ "chacmool.wrl" ] # object to be lit
}
ROUTE DETECTOR.enterTime TO TIMER.startTime
ROUTE TIMER.fraction_changed TO LIGHT.intensity
Here is the dimmer switch example in action.
![]()
Maintained by
H. Edward Donley
<hedonley@grove.iup.edu>
Last Modified Monday, 13-Aug-2001 16:53:26 EDT