<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Interactive'  version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.3.xsd ' >
<head>
<meta name='titlecontent='Lamp.x3d'/>
<meta name='descriptioncontent='Desk lampillustrate the use of multiple sensors, nested into groups within groups along with the shapes they sense.'/>
<meta name='creatorcontent='David R. Nadeau'/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='1 July 1998'/>
<meta name='translatedcontent='2 February 2014'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent='originals/lamp.wrl'/>
<meta name='referencecontent=' http://www.siggraph.org/s98 '/>
<meta name='referencecontent=' http://www.siggraph.org/s98/conference/courses/18.html '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0173.htm '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Lamp.x3d '/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: FirstArm, Lamp, LampArm, LampShade, MoveFirstArm, MoveLamp, MoveLampShade, MoveSecondArm, Red, SecondArm

Index for Viewpoint node: Viewpoint_1
-->
<Scene>
<WorldInfo info='"Copyright (c) 1997, Andrea L. Ames, David R. Nadeau, John L. Moreland"title='Desk lamp'/>
<Viewpoint description='Entry viewposition='0.0 0.15 1.0'/>
<NavigationInfo/>
<Transform>
<Shape>
<Appearance>
<Material diffuseColor='0.0 0.0 0.0emissiveColor='0.7 0.7 0.7'/>
</Appearance>
<Box size='2.25 0.01 2.25'/>
</Shape>
</Transform>
<Transform rotation='1.0 0.0 0.0 1.571translation='0.0 0.01 0.0'>
<!-- ROUTE information for MoveLamp node:  [from translation_changed to Lamp.set_translation ] -->
<PlaneSensor DEF='MoveLamp'/>

<!-- ROUTE information for Lamp node:  [from MoveLamp.translation_changed to set_translation ] -->
<Transform DEF='Lamprotation='1.0 0.0 0.0 -1.571'>
<Shape>
<Appearance>
<Material diffuseColor='0.5 0.5 0.5'/>
</Appearance>
<Cylinder height='0.01radius='0.1'/>
</Shape>
<Group>
<!-- ROUTE information for MoveFirstArm node:  [from rotation_changed to FirstArm.set_rotation ] -->
<CylinderSensor DEF='MoveFirstArm'/>

<!-- ROUTE information for FirstArm node:  [from MoveFirstArm.rotation_changed to set_rotation ] -->
<Transform DEF='FirstArm'>
<Transform center='0.0 -0.15 0.0rotation='1.0 0.0 0.0 -0.7translation='0.0 0.15 0.0'>
<Shape DEF='LampArm'>
<Appearance DEF='Red'>
<Material diffuseColor='1.0 0.2 0.2'/>
</Appearance>
<Cylinder height='0.3radius='0.01'/>
</Shape>
<Group>
<!-- ROUTE information for MoveSecondArm node:  [from rotation_changed to SecondArm.set_rotation ] -->
<CylinderSensor DEF='MoveSecondArm'/>

<!-- ROUTE information for SecondArm node:  [from MoveSecondArm.rotation_changed to set_rotation ] -->
<Transform DEF='SecondArm'>
<Transform center='0.0 -0.15 0.0rotation='1.0 0.0 0.0 1.9translation='0.0 0.3 0.0'>
<Shape USE=' LampArm'/>
<Group>
<!-- ROUTE information for MoveLampShade node:  [from rotation_changed to LampShade.set_rotation ] -->
<SphereSensor DEF='MoveLampShadeoffset='1.0 0.0 0.0 -1.25'/>

<!-- ROUTE information for LampShade node:  [from MoveLampShade.rotation_changed to set_rotation ] -->
<Transform DEF='LampShadecenter='0.0 0.075 0.0rotation='1.0 0.0 0.0 -1.25translation='0.0 0.075 0.0'>
<Shape>
<Appearance USE=' Red'/>
<Cone bottom='falsebottomRadius='0.12height='0.15'/>
</Shape>
<Transform translation='0.0 0.075 0.0'>
<Shape>
<Appearance>
<Material diffuseColor='1.0 1.0 1.0'/>
</Appearance>
<Cylinder height='0.03radius='0.007'/>
</Shape>
</Transform>
<Transform translation='0.0 -0.05 0.0'>
<Shape>
<Appearance>
<Material diffuseColor='0.0 0.0 0.0emissiveColor='1.0 1.0 1.0'/>
</Appearance>
<Sphere radius='0.05'/>
</Shape>
</Transform>
</Transform>
</Group>
</Transform>
</Transform>
</Group>
</Transform>
</Transform>
</Group>
</Transform>
</Transform>
< ROUTE  fromNode=' MoveLamp' fromField='translation_changed' toNode=' Lamp' toField='set_translation'/>
< ROUTE  fromNode=' MoveFirstArm' fromField='rotation_changed' toNode=' FirstArm' toField='set_rotation'/>
< ROUTE  fromNode=' MoveSecondArm' fromField='rotation_changed' toNode=' SecondArm' toField='set_rotation'/>
< ROUTE  fromNode=' MoveLampShade' fromField='rotation_changed' toNode=' LampShade' toField='set_rotation'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: FirstArm, Lamp, LampArm, LampShade, MoveFirstArm, MoveLamp, MoveLampShade, MoveSecondArm, Red, SecondArm

Index for Viewpoint node: Viewpoint_1
-->

Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

MoveLampShade
SphereSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
LampShade
Transform
set_rotation
SFRotation


MoveLamp
PlaneSensor
translation_changed
SFVec3f

ROUTE
event to
(1)
Lamp
Transform
set_translation
SFVec3f


MoveFirstArm
CylinderSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
FirstArm
Transform
set_rotation
SFRotation


MoveSecondArm
CylinderSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
SecondArm
Transform
set_rotation
SFRotation


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/LampIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Lamp.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->