colorchange_0.wrl source
Viewpoint {}
NavigationInfo {
type "EXAMINE"
}
Group {
children [
Shape {
appearance Appearance {
material DEF Ball-Mt Material {
diffuseColor 1 0 0
}
}
geometry Sphere {}
}
DEF ThS TouchSensor {}
]
}
DEF Sc Script {
eventIn SFTime colorChange
eventOut SFColor ballColor
field SFColor col 0 1 0
field SFColor blue 0 0 1
url "javascript:
var
col =
blue;
function colorChange () {
ballColor = col;
}
"
}
ROUTE ThS.touchTime TO Sc.colorChange
ROUTE Sc.ballColor TO Ball-Mt.diffuseColor