#VRML V2.0 utf8
WorldInfo {
  title "Lightbulb - first version"
  info [ "Copyright 1999 by Bob Crispen " ]
}
NavigationInfo {
  type [ "EXAMINE" "ANY" ]
  headlight FALSE
}
Group {
  children [
    DEF Entry Viewpoint {
      description "Entry"
      position 0 0 1
    }
    DEF The_Box Transform {
      translation -0.2 -0.2 0
      rotation 0 1 0 0.78
      children [
	Shape {
	  appearance Appearance {
	    material Material {
	      diffuseColor 1 0 0
	      ambientIntensity 0
	    }
	  }
	  geometry Box { size 0.1 0.1 0.1 }
	}
      ]
    }
    DEF Lightbulb Transform {
      scale 0.35 0.35 0.35
      children [
        # Just enough light so you can see the lightbulb
	# Because this light is grouped with the lightbulb, you shouldn't
	# be able to see the box.
	DEF Dim_Bulb DirectionalLight {
	  intensity 0.3
	}
	Transform {
	  scale 0.193 0.193 0.193
	  children [
	    DEF Light1 PointLight {
	      intensity 1
	      on FALSE
	    }
	    Shape {
	      appearance Appearance {
		material Material {
		  diffuseColor 1 1 1
		  specularColor 1 1 1
		}
	      }
	      geometry Sphere {
		radius 1.4
	      }
	    }
	  ]
	}
	Transform {
	  translation 0 -0.35 0
	  children [
	    Shape {
	      appearance Appearance {
		material Material {
		  diffuseColor 1 1 0
		  specularColor 1 1 0
		}
	      }
	      geometry Cylinder {
		height 0.3
		radius 0.135
	      }
	    }
	  ]
	}
	DEF Sensor1 TouchSensor { }
      ]
    }
  ]
  ROUTE Sensor1.isActive TO Light1.set_on
}