tut20.wrl

#VRML V2.0 utf8

WorldInfo {
   title "Floppy's VRML97 Tutorial Example 20"
   info ["(C) Copyright 1999 Vapour Technology"
         "vrmlguide@vapourtech.com"]
}

DirectionalLight {
   direction 0 -1 -1
   ambientIntensity .5
}

Background {
   skyColor 0 0 0
}

DEF BACKRED Background {
   skyColor 1 0 0
}

DEF BACKGREEN Background {
   skyColor 0 1 0
}

DEF BACKBLUE Background {
   skyColor 0 0 1
}

Group {
   children [
      DEF WORLDVIEW Viewpoint {
         description "EntryWay"
         position 0 1.6 7.5
      }
      DEF MOVABLE NavigationInfo {
         headlight FALSE
      }
      DEF FLOOR Shape {
         appearance DEF METAL Appearance {
            material Material {
               shininess .75
               diffuseColor .75 .75 .75
               ambientIntensity .5
            }
         }
         geometry Cylinder {
            radius 10
            height .1
         }
      }
      Transform {
         translation 0 5 0
         children USE FLOOR
      }
      Shape {
         appearance Appearance {
            material Material {
               transparency 1
            }
         }
         geometry Cylinder {
            radius 10.1
            height 5
         }
      }
      DEF PILLAR Transform {
         translation 0 2.5 9
         children [
            Shape {
               appearance USE METAL
               geometry Cylinder {
                  radius .25
                  height 5
               }
            }
         ]
      }
      Transform {
         rotation 0 1 0 .78
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 1.57
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 2.36
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 3.14
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 3.93
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 4.71
         children USE PILLAR
      }
      Transform {
         rotation 0 1 0 5.5
         children USE PILLAR
      }
      Transform {
         translation -5 1 -3
         children [
            DEF WORLDSWITCH TouchSensor {
            }
            Shape {
               appearance Appearance {
                  material Material {
                     emissiveColor 1 1 0
                  }
               }
               geometry Sphere {
                  radius .1
               }
            }
         ]
      }
      Transform {
         translation -5 .5 -3
         children [
            Shape {
               appearance USE METAL
               geometry Cylinder {
                  radius .05
                  height 1
               }
            }
         ]
      }
      Transform {
         translation 5 .5 -3
         children [
            Shape {
               appearance USE METAL
               geometry Box {
                  size .5 1 2
               }
            }
         ]
      }
      Transform {
         translation 5 1 -3.5
         children [
            DEF REDSWITCH TouchSensor {
            }
            Shape {
               appearance Appearance {
                  material Material {
                     emissiveColor 1 0 0
                  }
               }
               geometry Sphere {
                  radius .2
               }
            }
         ]
      }
      Transform {
         translation 5 1 -3
         children [
            DEF GREENSWITCH TouchSensor {
            }
            Shape {
               appearance Appearance {
                  material Material {
                     emissiveColor 0 1 0
                  }
               }
               geometry Sphere {
                  radius .2
               }
            }
         ]
      }
      Transform {
         translation 5 1 -2.5
         children [
            DEF BLUESWITCH TouchSensor {
            }
            Shape {
               appearance Appearance {
                  material Material {
                     emissiveColor 0 0 1
                  }
               }
               geometry Sphere {
                  radius .2
               }
            }
         ]
      }
   ]
}

DEF PLATFORMTIMER TimeSensor {
   cycleInterval 60
   loop TRUE
}

DEF PLATFORMINT OrientationInterpolator {
   key [
      0 .25 .5 .75 1
   ]
   keyValue [
      0 -1 0 0 0 -1 0 1.57 0 -1 0 3.14 0 -1 0 4.71 0 -1 0 0
   ]
}

DEF PLATFORM Transform {
   children [
      Transform {
         translation 0 0 20
         children [
            DEF PLATFORMVIEW Viewpoint {
               position 0 1.6 1
            }
            Shape {
               appearance USE METAL
               geometry Box {
                  size 2.2 .1 2.2
               }
            }
         ]
      }
   ]
}

#Platform animation
ROUTE PLATFORMTIMER.fraction_changed TO PLATFORMINT.set_fraction
ROUTE PLATFORMINT.value_changed TO PLATFORM.rotation

#NavigationInfo updating
ROUTE WORLDVIEW.isBound TO MOVABLE.set_bind

#Viewpoint binding
ROUTE WORLDSWITCH.isActive TO PLATFORMVIEW.set_bind

#Background binding
ROUTE REDSWITCH.isActive TO BACKRED.set_bind
ROUTE GREENSWITCH.isActive TO BACKGREEN.set_bind
ROUTE BLUESWITCH.isActive TO BACKBLUE.set_bind

Generated by GNU enscript 1.6.1.

© Copyright 1999 Vapour Technology - vrmlguide@vapourtech.com - http://www.vapourtech.com/vrmlguide