#vrml v2.0 utf8
proto flipper [
field sfvec3f position 0 0 0
]
{
group {
children [
transform {
translation is position
children [
def touch touchsensor {}
shape {
appearance appearance {
material def mat material {
emissivecolor 1 0 0
}
}
geometry indexedfaceset {
coord coordinate {
point [ 1 1 0, -1 1 0, -1 -1 0, 1 -1 0 ]
}
coordindex [ 0 1 2 3 ]
}
}
]
}
def timer timesensor { cycleinterval 4 }
def colorer colorinterpolator {
key [ 0 .5 1 ]
keyvalue [ 1 0 0, 0 1 0, 1 0 0 ]
}
def script script {
eventin sfbool isover
eventout sftime starttime
url "vrmlscript:
function isover(val, ts) {
starttime = ts;
}"
}
]
route touch.isover to script.isover
route script.starttime to timer.starttime
route timer.fracti to colorer.set_fraction
route colorer.value_changed to mat.emissivecolor
}
}
flipper { position -4 4 0 }
flipper { position -2 4 0 }
flipper { position 0 4 0 }
flipper { position 2 4 0 }
flipper { position 4 4 0 }
flipper { position -4 2 0 }
flipper { position -2 2 0 }
flipper { position 0 2 0 }
flipper { position 2 2 0 }
flipper { position 4 2 0 }
flipper { position -4 0 0 }
flipper { position -2 0 0 }
flipper { position 0 0 0 }
flipper { position 2 0 0 }
flipper { position 4 0 0 }
flipper { position -4 -2 0 }
flipper { position -2 -2 0 }
flipper { position 0 -2 0 }
flipper { position 2 -2 0 }
flipper { position 4 -2 0 }
flipper { position -4 -4 0 }
flipper { position -2 -4 0 }
flipper { position 0 -4 0 }
flipper { position 2 -4 0 }
flipper { position 4 -4 0 }
navigati {
headlight false
type "none"
}
viewpoint { position 0 0 15 }
background { skycolor 1 1 1 }
转载于:https://blog.51cto.com/sunlilei/4520