<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"   "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile="Full">
  <head>
    <meta name="filename" content="anim-touch-4.x3d"/>
    <meta name="description" content="*enter description here, short-sentence summaries preferred*"/>
    <meta name="author" content="*enter name of original author here*"/>
    <meta name="translator" content="*if manually translating VRML-to-X3D, enter name of person translating here*"/>
    <meta name="created" content="*enter date of initial version here*"/>
    <meta name="translated" content="18 April 2005"/>
    <meta name="revised"    content="18 April 2005"/>
    <meta name="version" content="*enter version here*"/>
    <meta name="reference" content="*enter reference citation or relative/online url here*"/>
    <meta name="reference" content="*enter additional url/bibliographic reference information here*"/>
    <meta name="copyright" content="*enter copyright information here* Example:  Copyright (c) Web3D Consortium Inc. 2002"/>
    <meta name="drawing" content="*enter drawing filename/url here*"/>
    <meta name="image" content="*enter image filename/url here*"/>
    <meta name="movie" content="*enter movie filename/url here*"/>
    <meta name="photo" content="*enter photo filename/url here*"/>
    <meta name="keywords" content="*enter keywords here*"/>
    <meta name="url" content="*enter online url address for this file here*"/>
    <meta name="generator" content="Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"/>
  </head>
  <Scene>
  <WorldInfo  info='"Touch the light switch and light the dark blue one"'/>
  <NavigationInfo  headlight="true"/>
  <Viewpoint  DEF="EntryVP"  description="Normal viewpoint" position="0.0 0.0 7.0"/>
  <Viewpoint  DEF="CloseVP"  description="Close viewpoint" position="0.0 0.0 4.0"/>
  <Viewpoint  DEF="FarVP"  description="Far viewpoint" position="0.0 0.0 10.0"/>
  <Transform  DEF="LightSwitch"  translation="-0.5 0.5 4.0">
      <Switch  DEF="Switcher"  whichChoice="0">
          <Group >
              <TouchSensor  DEF="LightSwitchONSensor" />
              <Inline  url='"../common/light-switch.x3d"'/>
          </Group>
          <Group >
              <TouchSensor  DEF="LightSwitchOFFSensor"  enabled="false"/>
              <Inline  url='"../common/light-switch2.x3d"'/>
          </Group>
      </Switch>
  </Transform>
  <PointLight  DEF="LIGHT"  location="-3.0 2.0 2.0" on="false"/>
  <Shape >
      <Appearance >
          <Material  shininess="1.0" diffuseColor="0.0 0.0 0.4"/>
      </Appearance>
      <Sphere  radius="1.0"/>
  </Shape>
  <Script DEF="lightONScript" directOutput="true" url="&quot;vrmlscript:&#10;		function lightONIsActive(active) {&#10;			light.set_on = TRUE;&#10;                        lightswitch.set_whichChoice = 1;&#10;                        offsensor.set_enabled = TRUE;&#10;&#10;		}&quot;&quot;javascript:&#10;		function lightONIsActive(active) {&#10;			light.set_on = TRUE;&#10;                        lightswitch.set_whichChoice = 1;&#10;                        offsensor.set_enabled = TRUE;&#10;&#10;		}&quot;">
    <field name="lightONIsActive" type="SFBool" accessType="inputOnly"/>
    <field name="offsensor" type="SFNode" accessType="initializeOnly">
      <TouchSensor USE="LightSwitchOFFSensor"/>
    </field>
    <field name="light" type="SFNode" accessType="initializeOnly">
      <PointLight USE="LIGHT"/>
    </field>
    <field name="lightswitch" type="SFNode" accessType="initializeOnly">
      <Switch USE="Switcher"/>
    </field>
  </Script>
<ROUTE fromNode="LightSwitchONSensor" fromField="isActive" toNode="lightONScript" toField="lightONIsActive"/>
  <Script DEF="lightOFFScript" directOutput="true" url="&quot;vrmlscript:&#10;		function lightOFFIsActive(active) {&#10;			light.set_on = FALSE;&#10;                        lightswitch.set_whichChoice = 0;&#10;		}&quot;&quot;javascript:&#10;		function lightOFFIsActive(active) {&#10;			light.set_on = FALSE;&#10;                        lightswitch.set_whichChoice = 0;&#10;		}&quot;">
    <field name="light" type="SFNode" accessType="initializeOnly">
      <PointLight USE="LIGHT"/>
    </field>
    <field name="lightOFFIsActive" type="SFBool" accessType="inputOnly"/>
    <field name="lightswitch" type="SFNode" accessType="initializeOnly">
      <Switch USE="Switcher"/>
    </field>
  </Script>
<ROUTE fromNode="LightSwitchOFFSensor" fromField="isActive" toNode="lightOFFScript" toField="lightOFFIsActive"/>
  </Scene>

</X3D>
