VRML: Plane Sensor


(world)
(from The Annotated VRML 2.0 Reference Manual)

#VRML V2.0 utf8
Group { children [
  Transform {
    translation 0 1 0
    rotation 1 0 0 1.57  # rotate sensor into XZ plane
    children [
      DEF T1 Transform {
        rotation 1 0 0 -1.57  # unrotate so that cone is upright
        children Shape {
          appearance DEF A1 Appearance {
            material Material { diffuseColor 1 1 1 }
          }
          geometry Cone { bottomRadius 1 height 2 }
        }
      }
      DEF PS1 PlaneSensor {
	minPosition -5 -5
	maxPosition 5 5
      }
    ]
  }
  Transform {
    translation 5 0 0 
    rotation 1 0 0 1.57
    children [
      DEF PS2 PlaneSensor {
	minPosition 0 -5
	maxPosition 0 5
#	offset 5 0 0    # not sure if this has any effect!!!???
      }
      DEF T2 Transform {
	children Shape {
          geometry Box { size .5 .5 .5 }
          appearance USE A1
	}
      }
    ]
  }
  Transform {
    translation 0 0 -5 
    rotation 1 0 0 1.57
    children [
      DEF PS3 PlaneSensor {
	minPosition -5 0
	maxPosition 5 0
#	offset 0 -5 0 
      }
      DEF T3 Transform {
	children Shape {
          geometry Cylinder { radius 0.5 height 1 }
          appearance USE A1
	}
      }
    ]
  }
  Transform {               # table
    translation 0 -0.1 0
    children Shape {
      geometry Box { size 10 0.2 10 }
      appearance USE A1
    }
  }
  Background { skyColor 1 1 1 }
  NavigationInfo { type "EXAMINE" }
]}
ROUTE PS1.translation_changed TO T1.set_translation
ROUTE PS2.translation_changed TO T2.set_translation
ROUTE PS2.translation_changed TO T1.set_translation
ROUTE PS3.translation_changed TO T3.set_translation
ROUTE PS3.translation_changed TO T1.set_translation
#ROUTE PS2.offset_changed TO PS1.set_offset
#ROUTE PS3.offset_changed TO PS1.set_offset


mrl