#VRML V2.0 utf8 ## anonymous ## ##@ world Viewpoint { position 0 0 10 } Background { skyColor 1 0 0 } ##@ proto PROTO clip [ exposedField MFString url [ "relation-in-time.wmv" ] exposedField MFString name [ "clip" ] exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ]{ ##@ body Transform { translation IS translation rotation IS rotation scale IS scale children [ ##@ sensor DEF sensor TouchSensor {} Shape { appearance Appearance { material Material {} texture DEF video MovieTexture { loop TRUE url IS url ## "relation-in-time.wmv" } } geometry Box { size 10 5 0.1 } } ##@ text & sound Transform { translation -2.5 -3 0 children [ ##Billboard { ##children [ DEF text Text { } ## ] } ## billboard ] } DEF sound Sound { source USE video } ##@ script DEF script Script { directOutput TRUE eventIn SFTime touch field SFNode video USE video field SFNode sound USE sound field SFNode text USE text field SFInt32 state 1 field MFString string IS name field MFString string0 [ "playing" ] field MFString string1 [ "stopped" ] url "javascript: function initialize() { text.string = string; } //@ touch function touch(value) { if (state == 0) { text.string = string0; video.startTime = value; sound.startTime = value; video.stopTime = 0; sound.stopTime = 0; state = 1; } else { text.string = string1; video.stopTime = value; sound.stopTime = value; state = 0; } } " } ##@ route ROUTE sensor.touchTime TO script.touch ] } ## end group } ## end proto ##@ clip clip { url "local/clips/abramovic/relation-in-time.wmv" name "relation in time" translation -4 0 0 rotation 0 1 0 75 } clip { url "local/clips/abramovic/relation-in-time.wmv" name "relation in time" translation 4 0 0 rotation 0 1 0 -75 } ##