#VRML V2.0 utf8

Group { 
    children [
        Transform {
            translation 0 -1 0

            children Shape {
                appearance Appearance {
                    material Material { }
                }
                geometry Box { size 30 0.2 30 }
            }
        }
        Transform {
            translation -1 0 0

            children Shape {
                appearance Appearance {
                    material Material { 
                        diffuseColor 0.5 0.8 0 
                    }
                }
                geometry Cone { }
            }
        }
        Transform {
            translation 1 0 0

            children Shape {
                appearance Appearance {
                    material Material { 
                        diffuseColor 0 0.2 0.7 
                    }
                }
                geometry Cylinder { }
            }
        }

        DEF GuideTransform Transform {
            children [
                DEF TourGuide Viewpoint { jump FALSE },
                DEF ProxSensor ProximitySensor { size 50 50 50 }
                DEF StartTour TouchSensor { },
                Transform {
                    translation 0.6 0.4 8

                    children Shape { 
                        appearance Appearance {
                            material Material { 
                                diffuseColor 1 0.6 0 
                            }
                        }
                        geometry Sphere { radius 0.2 } 
                    } # the guide orb
                }
            ]
        }
    ]
}

DEF GuidePI PositionInterpolator {
    key [ 0, 0.2, 0.3, 0.5, 0.6, 0.8, 0.9, 1 ]
    keyValue [ 0 0 0, 0 0 -5,
               2 0 -5, 2 6 -15
               -4 6 -15, -4 0 -5,
               0 0 -5, 0 0 0
    ]
}

DEF GuideRI OrientationInterpolator {
    key [ 0, 0.2, 0.3, 0.5, 0.6, 0.8, 0.9, 1 ]
    keyValue [ 0 1 0 0, 0 1 0 0, 
               0 1 0 1.2, 0 1 0 3, 
               0 1 0 3.5, 0 1 0 5, 
               0 1 0 0, 0 1 0 0, 
    ]
}

DEF TS TimeSensor { cycleInterval 30 } # 60 second tour

ROUTE ProxSensor.isActive TO StartTour.set_enabled
ROUTE StartTour.touchTime TO TS.startTime
ROUTE TS.isActive TO TourGuide.set_bind
ROUTE TS.fraction_changed TO GuidePI.set_fraction
ROUTE TS.fraction_changed TO GuideRI.set_fraction
ROUTE GuidePI.value_changed TO GuideTransform.set_translation
ROUTE GuideRI.value_changed TO GuideTransform.set_rotation
