#VRML V2.0 utf8

Viewpoint { fieldOfView 1.2 }

DEF T1 Transform  {
	translation	-8 -1 0
	children [
    	Shape {appearance DEF AP1 Appearance {
				material Material	{diffuseColor 1 0 0}  }
        	geometry Box {}}
		Sound {
			maxBack 100
			maxFront 100
			source DEF AC1 AudioClip {
				loop TRUE
				url ["passport.mid"]
			}
			intensity 0.7
		}
	]
}

DEF T2 Transform  {
	translation	8 1 0
	children [
    	Shape {appearance USE AP1
        	geometry Sphere {}}
		Sound {
			maxBack 100
			maxFront 100
			source DEF AC2 AudioClip {
				url ["eff_open.mid"]
			}
		}

	]
}

Transform  {
	translation	-2 -5 0
	children [
		DEF TS1 TouchSensor {}
    	Shape {appearance USE AP1 
        	geometry Box {size 4 2 0.2}}
    	Transform  {
        	translation -1.5 -0.2 0.21
			children   Shape	{geometry Text {
					string ["Click me"]
				} } }

	]}

DEF	PI1 PositionInterpolator {
	key [0,0.5,1]
	keyValue [-8 -1 0,8 -1 0,-8 -1 0]
}

DEF	PI2 PositionInterpolator {
	key [0,0.5,1]
	keyValue [8 1 0,-8 1 0,8 1 0]
}

DEF	TM1 TimeSensor {
	cycleInterval 8
	loop TRUE
}

DEF	TM2 TimeSensor {
	cycleInterval 5
	loop TRUE
}

ROUTE TS1.touchTime TO AC2.startTime

ROUTE TM1.fraction_changed TO PI1.set_fraction
ROUTE PI1.value_changed	TO T1.translation
ROUTE TM2.fraction_changed TO PI2.set_fraction
ROUTE PI2.value_changed	TO T2.translation  