#VRML V2.0 utf8
WorldInfo {
   title "The Cardiac Museum"
   info ["Sept. 2004 by Flavio H Fenton"
         "flavio.h.fenton@hofstra.edu"]
}

## sky ##
Background { 
  skyColor [
    0.0  0.1  0.8,
    0.0  0.5  1.0,
    1.0  1.0  1.0
  ]
  skyAngle [
    0.785,
    1.571
  ]
  groundColor [ 
    0.0  0.0  0.0,
    0.1  0.3  0.1,
    0.2  0.5  0.2
  ]
  groundAngle [
    0.785,
    1.571
  ]

	frontUrl "http://arrhythmia.hofstra.edu/vrml/museumn/dd.jpg"
	backUrl  "http://arrhythmia.hofstra.edu/vrml/museumn/dd.jpg"
	leftUrl  "http://arrhythmia.hofstra.edu/vrml/museumn/d.jpg"
	rightUrl "http://arrhythmia.hofstra.edu/vrml/museumn/d.jpg"

}  

## collision detection on ##
Collision {
  children [

## navigation info ##
    NavigationInfo {
      speed 20
      headlight FALSE
      type "FLY"
    }

## light ##
    DirectionalLight {
      ambientIntensity 0.1
      color 0.8  0.8  0.8
    }

## transform scenery ##
    Transform {
      children [
Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/posttourn.wrl" }
           scale 3 3 3
     	     translation 15.0 8.0 130.0
        }

## room1 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/tree.wrl" }
          scale 12 12 1
          translation -70 -10 100
        }

## door ##
       Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/slidedoor.wrl" }
           scale 11 12 1
     	     translation 0.0 -9.0 -34.0

        }
 Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/ddoornn.wrl" }
           scale 10 12 1
     	     translation -25.0 -9.0 -38.0
        }
Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/ddoornn.wrl" }
           scale 12 12 1
     	     translation 27.0 -9.0 -38.0
        }

Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/ddoorn.wrl" }
           scale 54 5 5
     	     translation 0.0 21.5 65.0
        }

## door 2##
       Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/slidedoor.wrl" }
           scale 11 11.5 1
     	     translation 0.0 -7.0 70.0

        }
    ##sensor outsi
          Transform {
           translation 0 0 145
            children [
             DEF OutsiSense ProximitySensor {
              center 0.0 0.0 0.0
              size 58. 18.5 150
            }     
#             Box{size 58 18.5  150}
                    ]
                   }
    ##sensor lobby
          Transform {
           translation 0 0 15
            children [
             DEF LobbySense ProximitySensor {
              center 0.0 0.0 0.0
              size 58. 18.5 97
            }     
#             Box{size 58 18.5  97}
                    ]
                   }
##Sensor sroom1
Transform {
           translation 0 0 -120
            children [
             DEF sroom1Sense ProximitySensor {
              center 0.0 0.0 0.0
              size 68. 21.5 163
            }     
  #           Box{size 68 18.5  163}
                    ]
                   }
##Sensor sroom2
Transform {
           translation 170 0 -105
            children [
             DEF sroom2Sense ProximitySensor {
              center 0.0 0.0 0.0
              size 98. 21.5 163
            }     
#             Box{size 98 18.5  163}
                    ]
                   }

##Sensor sroom3
Transform {
           translation 120 0 -295
            children [
             DEF sroom3Sense ProximitySensor {
              center 0.0 0.0 0.0
              size 98. 18.5 163
            }     
 #           Box{size 98 21.5  163}
                    ]
                   }
##Sensor sroom4
Transform {
           translation 290 0 -335
            children [
             DEF sroom4Sense ProximitySensor {
              center 0.0 0.0 0.0
              size 98. 18.5 163
            }     
#            Box{size 98 18.5  163}
                    ]
                   }
##Sensor sout2
Transform {
           translation 396 0 -335
            children [
             DEF sout2Sense ProximitySensor {
              center 0.0 0.0 0.0
              size 98. 18.5 163
            }     
#            Box{size 98 18.5  163}
                    ]
                   }




 Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/ddoornn.wrl" }
           scale 11 11.5 1
     	     translation -26.0 -7.0 65.0
        }
Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/ddoornn.wrl" }
           scale 12 11.5 1
     	     translation 26.0 -7.0 65.0
        }

## room1 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/room1an2.wrl" }
        }

## room2 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/room2.wrl" }
        }

## room3 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/room3.wrl" }
        }

## room4 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/room4.wrl" }
        }

## passage1 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/passage1.wrl" }
        }

## passage2 ##
        Transform {
          children Inline { url "http://arrhythmia.hofstra.edu/vrml/museumn/passage2.wrl" }
        }

## end transform scenery ##
      ]
      translation -23.0 -10.6 -60.0
    }

## end collision detection on ##
  ]
  collide TRUE
}
        
DEF GuideTransform Transform {   translation -8 -5.5 70

            children [
                            DEF TourGuide Viewpoint { position -18 0 45  }

                DEF ProxSensor ProximitySensor { size .9 .9 .9 }
                Shape { geometry Sphere { radius 3} 
                       appearance Appearance {
            material Material {
              transparency 1
            }
             
          }
                }, # the guide orb
                DEF StartTour TouchSensor { }
            ]

        }

DEF Timer TimeSensor { cycleInterval 150 }

DEF Translator PositionInterpolator {
	key [ 0, .028, .06, .08, .105, .135, .165,
           .21, .24, .265, .28, .3,
            .325, .35, .4, .45,
            .465,.485,.52,.565,
            .6,.63,.675,.7,.74,.78,
            .8,.81,.83,.85,
             .87,.9,.93,.96,1
]
	keyValue [
-8 -5.5 70, -8.5666 -3 -43.9692, -50.3045 -3 -44.0704
-55.7138 -3 -30.914, -55.6451 -2 -50.811, -33.4842 0 -47.55
-39.9418 2 -59.31, -0.8455 0 -90.038, -29.0421 0 -190.804
-1.8326 -7.30014 -230.174, -1.8326 -7.30014 -230.174,
 -46.1176 2.43338 -255.039					

9.85021 2.43338 -265.639, 11.2052 -2.43338 -213.075,
209.641 -10.43338 -210.208, 165.791 -4.43338 -193.274

145.952 -10.43338 -240.284, 200.952 -3.43338 -380.353
150.403 -3.43338 -369.132, 85.738 -4.86676 -368.104
120.8499 -9.86676 -376.423, 120.4663 -6.86676 -345.092					
221.201 -4.86676 -340.573, 276.972 -6.86676 -340.06
250.331 -11.0014 -355.431, 361.862 -7.30014 -365.926
334.812 -7.30014 -513.191, 135.115 -7.30014 -499.796
-74.953 -7.30014 -486.126, -303.356 -7.30014 -488.311
-381.034 7.30014 -44.5806, -198.127 4.86676 402.023
-16.9064 4.86676 326.0857, -8 -5.5 70
]
}# end of Translator	

DEF Rotator OrientationInterpolator {
	key [ 0, .028, .06, .08, .105, .135, .165,
           .21, .24, .265, .28, .3,
            .325, .35, .4, .45,
            .465,.485,.52,.565,
            .6,.63,.675,.7,.74,.78,
            .8,.81,.83,.85,
             .87, .9,.93,.96
1
]
	keyValue [
0 0 0 0
0 0 0 0
                              0 -1 0 0.626813
					0 -1 0 1.71195
					0 -1 0 1.96742
					0 1 0 2.49522
					0 1 0 1.36664
					0 1 0 0.00739105
					0 1 0 0.792489
					0 -1 0 0.00683104
					0 -1 0 0.00
					0 1 0 0.281521					
0 1 0 0.281521
					0 -1 0 1.55543
					0 -1 0 1.55543
					0 -1 0 3.1404
					0 -1 0 4.7124
					0 -1 0 0.0227314
					0 1 0 1.5654
				0 1 0 1.65295
					0 -1 0 0.224988
				 0 -1 0 1.81243
					
0 -1 0 1.37687
					0 -1 0 1.56951
					0 1 0 2.88117
					0 -1 0 1.94456
					0 1 0 1.53259
					0 1 0 2.08606
					0 -1 0 3.05368
					0 -1 0 2.60552
					0 -1 0 1.55912
					0 -1 0 0.550247
					0 1 0 0.028093
0 1 0 0.028093
				0 0 0 0	
]
}

DEF Control Script{
eventIn SFBool lobby
eventIn SFBool sroom1
eventIn SFBool outsi
eventIn SFBool sroom2
eventIn SFBool sroom3
eventIn SFBool sroom4
eventIn SFBool sout2
url "javascript:
     function outsi(value) {
     if(value==true){
     Browser.loadURL('museumtop.html', 'target=museumtop');
         }
      }
     function lobby(value) {
     if(value==true){
     Browser.loadURL('lobby.html', 'target=museumtop');
         }
      }
     function sroom1(value) {
     if(value==true){
     Browser.loadURL('sroom1.html', 'target=museumtop');
         }
      }
     function sroom2(value) {
     if(value==true){
     Browser.loadURL('sroom2.html', 'target=museumtop');
         }
      }
     function sroom3(value) {
     if(value==true){
     Browser.loadURL('sroom3.html', 'target=museumtop');
         }
      }
     function sroom4(value) {
     if(value==true){
     Browser.loadURL('sroom4.html', 'target=museumtop');
         }
      }
     function sout2(value) {
     if(value==true){
     Browser.loadURL('sout2.html', 'target=museumtop');
         }
      }

     "
                      }

ROUTE StartTour.touchTime TO Timer.startTime
ROUTE Timer.fraction_changed TO Translator.set_fraction
ROUTE Timer.fraction_changed TO Rotator.set_fraction
ROUTE Translator.value_changed TO GuideTransform.set_translation
ROUTE Rotator.value_changed TO GuideTransform.set_rotation

ROUTE LobbySense.isActive TO Control.lobby
ROUTE sroom1Sense.isActive TO Control.sroom1
ROUTE OutsiSense.isActive TO Control.outsi
ROUTE sroom2Sense.isActive TO Control.sroom2
ROUTE sroom3Sense.isActive TO Control.sroom3
ROUTE sroom4Sense.isActive TO Control.sroom4
ROUTE sout2Sense.isActive TO Control.sout2


