<?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='Interactive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='Figure09.9DeskLamp.x3d'/>
<meta name='creatorcontent='Figure 9.9, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='referencecontent=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch09/09fig09.htm '/>
<meta name='transcribercontent='Don Brutzman'/>
<meta name='createdcontent='12 August 2000'/>
<meta name='modifiedcontent='1 February 2014'/>
<meta name='descriptioncontent='A desk lamp with arm angles that can be adjusted using nested sensors.'/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09-SensingViewer/Figure09.9DeskLamp.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<Viewpoint description='Desk lampposition='0 0.2 1'/>
<!-- First rotate PlaneSensor to horizontal XZ (Y = 0) plane -->
<Transform rotation='1 0 0 1.57'>
<!-- MOVE_LAMP ROUTE:  [from translation_changed to LAMP_TRANSFORM.set_translation ] -->
<PlaneSensor DEF='MOVE_LAMPdescription='drag to move lampmaxPosition='0.1 0.1minPosition='-0.1 -0.1'/>
<!-- LAMP_TRANSFORM ROUTE:  [from MOVE_LAMP.translation_changed to set_translation ] -->
<Transform DEF='LAMP_TRANSFORM'>
<!-- Note that we are connecting a chain of behavior engines in these ROUTEs. The event types passed via each ROUTE must each match. -->
<ROUTE fromNode='MOVE_LAMPfromField='translation_changedtoNode='LAMP_TRANSFORMtoField='set_translation'/>
<!-- Now rotate back so that actual geometry remains in original coordinate system -->
<Transform rotation='1 0 0 -1.57'>
<Shape>
<Cylinder height='0.01radius='0.1'/>
<Appearance DEF='WHITE'>
<Material diffuseColor='.9 .9 .9'/>
</Appearance>
</Shape>
<Group>
<!-- MOVE_FIRST_ARM ROUTE:  [from rotation_changed to FIRST_ARM_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_FIRST_ARMdescription='rotate first armoffset='1 0 0 -0.7'/>
<!-- FIRST_ARM_TRANSFORM ROUTE:  [from MOVE_FIRST_ARM.rotation_changed to set_rotation ] -->
<Transform DEF='FIRST_ARM_TRANSFORMcenter='0 -0.15 0rotation='1 0 0 -0.7translation='0 0.15 0'>
<ROUTE fromNode='MOVE_FIRST_ARMfromField='rotation_changedtoNode='FIRST_ARM_TRANSFORMtoField='set_rotation'/>
<Shape DEF='LAMP_ARM'>
<Appearance DEF='LIGHT_BROWN'>
<Material diffuseColor='.6 .6 .2'/>
</Appearance>
<Cylinder height='0.3radius='0.01'/>
</Shape>
<Group>
<!-- MOVE_SECOND_ARM ROUTE:  [from rotation_changed to SECOND_ARM_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_SECOND_ARMdescription='rotate second armoffset='1 0 0 1.9'/>
<!-- SECOND_ARM_TRANSFORM ROUTE:  [from MOVE_SECOND_ARM.rotation_changed to set_rotation ] -->
<Transform DEF='SECOND_ARM_TRANSFORMcenter='0 -0.15 0rotation='1 0 0 1.9translation='0 0.3 0'>
<ROUTE fromNode='MOVE_SECOND_ARMfromField='rotation_changedtoNode='SECOND_ARM_TRANSFORMtoField='set_rotation'/>
<Shape USE='LAMP_ARM'/>
<Group>
<!-- MOVE_LAMP_SHADE ROUTE:  [from rotation_changed to LAMP_SHADE_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_LAMP_SHADEdescription='rotate lamp shadeoffset='1 0 0 -1.25'/>
<!-- LAMP_SHADE_TRANSFORM ROUTE:  [from MOVE_LAMP_SHADE.rotation_changed to set_rotation ] -->
<Transform DEF='LAMP_SHADE_TRANSFORMcenter='0 0.07 0rotation='1 0 0 -1.25translation='0 0.075 0'>
<ROUTE fromNode='MOVE_LAMP_SHADEfromField='rotation_changedtoNode='LAMP_SHADE_TRANSFORMtoField='set_rotation'/>
<Shape>
<Appearance>
<Material diffuseColor='.1 .6 .6'/>
</Appearance>
<Cone bottom='falsebottomRadius='0.12height='0.15'/>
</Shape>
<Transform translation='0 -0.05 0'>
<Shape>
<Appearance>
<Material diffuseColor='.4 .4 .1emissiveColor='.8 .8 .2'/>
</Appearance>
<Sphere radius='0.05'/>
</Shape>
<SpotLight beamWidth='1.570796color='.8 .8 .1cutOffAngle='.785398direction='0 -1 0'/>
</Transform>
</Transform>
</Group>
</Transform>
</Group>
</Transform>
</Group>
</Transform>
</Transform>
</Transform>
</Scene>
</X3D>
<!--

Index for DEF nodes : FIRST_ARM_TRANSFORM, LAMP_ARM, LAMP_SHADE_TRANSFORM, LAMP_TRANSFORM, LIGHT_BROWN, MOVE_FIRST_ARM, MOVE_LAMP, MOVE_LAMP_SHADE, MOVE_SECOND_ARM, SECOND_ARM_TRANSFORM, WHITE

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->