floor2.wrl

#VRML V2.0 utf8

WorldInfo {
   title "Floppy's VRML Workshop Infinite Floor Example"
   info ["(C) Copyright 1999 Vapour Technology"
         "guide@web3dguide.org.uk"]
}

NavigationInfo {
   headlight FALSE
}

Viewpoint {
   description "Entryway"
   position 0 1.5 10
}

DirectionalLight {
   direction 0 -1 0
}

Background {
   skyColor 1 1 1
}

DEF SENSOR ProximitySensor {
   size 10 10 10
   center 0 1.5 10
}

DEF FLOOR Transform {
   children [
      Shape {
         appearance Appearance {
            texture ImageTexture {
               url "floor.png"
            }
            textureTransform TextureTransform {
               scale 50 50
            }
         }
         geometry Box {
            size 100 1e-8 100
         }
      }
   ]
}

Transform {
   translation 0 -1 -10
   children [
      Shape {
         appearance Appearance {
            material Material {
               diffuseColor 1 0 0
            }
         }
         geometry Sphere {
            radius 5
         }
      }
   ]
}

Transform {
   translation 20 -1 10
   children [
      Shape {
         appearance Appearance {
            material Material {
               diffuseColor 0 1 0
            }
         }
         geometry Sphere {
            radius 5
         }
      }
   ]
}

Transform {
   translation -20 -1 10
   children [
      Shape {
         appearance Appearance {
            material Material {
               diffuseColor 0 0 1
            }
         }
         geometry Sphere {
            radius 5
         }
      }
   ]
}


DEF FLOORPROC Script {
   eventIn SFVec3f set_position
   eventOut SFVec3f translation_changed
   url "javascript:
      function set_position(value,time) {
         translation_changed.x = value.x;
         translation_changed.z = value.z;
      }
   "
}

ROUTE SENSOR.position_changed TO FLOORPROC.set_position
ROUTE SENSOR.position_changed TO SENSOR.set_center

ROUTE FLOORPROC.translation_changed TO FLOOR.set_translation

Generated by GNU enscript 1.6.1.