<?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='Immersive' 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_9DeskLampWithAxes.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='9 March 2014'/>
<meta name='Imagecontent='Figure09_9DeskLampWithAxes.SlideshowSnapshot.png'/>
<meta name='descriptioncontent='A desk lamp with arm angles that can be adjusted using nested sensors, with coordinate axes superimposed to show X3D/VRML directions.'/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09SensingViewer/Figure09_9DeskLampWithAxes.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<Viewpoint description='Desk lamporientation='0 1 0 0.29position='0.3 0.2 1'/>
<!-- First rotate PlaneSensor to horizontal XZ (Y = 0) plane -->
<Transform rotation='1 0 0 1.57'>
<!-- ROUTE information for MOVE_LAMP node:  [from translation_changed to LAMP_TRANSFORM.set_translation ] -->
<PlaneSensor DEF='MOVE_LAMPdescription='drag to move lampmaxPosition='0.1 0.1minPosition='-0.1 -0.1'/>
<!-- ROUTE information for LAMP_TRANSFORM node:  [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>
<!-- ROUTE information for MOVE_FIRST_ARM node:  [from rotation_changed to FIRST_ARM_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_FIRST_ARMdescription='rotate first armoffset='1 0 0 -0.7'/>
<!-- ROUTE information for FIRST_ARM_TRANSFORM node:  [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>
<!-- ROUTE information for MOVE_SECOND_ARM node:  [from rotation_changed to SECOND_ARM_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_SECOND_ARMdescription='rotate second armoffset='1 0 0 1.9'/>
<!-- ROUTE information for SECOND_ARM_TRANSFORM node:  [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>
<!-- ROUTE information for MOVE_LAMP_SHADE node:  [from rotation_changed to LAMP_SHADE_TRANSFORM.set_rotation ] -->
<SphereSensor DEF='MOVE_LAMP_SHADEdescription='rotate lamp shadeoffset='1 0 0 -1.25'/>
<!-- ROUTE information for LAMP_SHADE_TRANSFORM node:  [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>
<!-- Adding this Inline reference to another scene superimposes X3D/VRML coordinate system axes. -->
<Transform scale='.25 .25 .25'> </Transform>
</Scene>
</X3D>
<!--

Index for DEF nodes : CoordinateAxes, 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'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D extensibility)
-->

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