X3D Model Documentation: Figure09_9DeskLampWithAxes.x3d go to online X3D Example Archives model page

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0'  xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='title' content=' Figure09_9DeskLampWithAxes.x3d '/>
  6            <meta name='creator' content='Figure 9.9, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='reference' content=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch09/09fig09.htm '/>
  8            <meta name='translator' content='Don Brutzman'/>
  9            <meta name='created' content='12 August 2000'/>
 10            <meta name='Image' content='Figure09_9DeskLampWithAxes.SlideshowSnapshot.png'image preview/>
 11            <meta name='description' content='A desk lamp with arm angles that can be adjusted using nested sensors, with coordinate axes superimposed to show X3D/VRML directions.'/>
 12            <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09SensingViewer/Figure09_9DeskLampWithAxes.x3d '/>
 13            <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 14            <meta name='license' content='../../license.html'/>
 15       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: 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 node: Viewpoint_1

-->
 16       <Scene>
 17            <WorldInfo title='Figure09_9DeskLampWithAxes.x3d'/>
 18            <Viewpoint description='Desk lamp' orientation='0 1 0 0.29' position='0.3 0.2 1'/>
 19            <!-- First rotate PlaneSensor to horizontal XZ (Y = 0) plane -->
 20            <Transform rotation='1 0 0 1.57'>
 21 
               <!-- ROUTE information for MOVE_LAMP node:  [from translation_changed to LAMP_TRANSFORM.set_translation ] -->
               <PlaneSensor DEF='MOVE_LAMP' description='drag to move lamp' maxPosition='0.1 0.1' minPosition='-0.1 -0.1'/>
 22 
               <!-- ROUTE information for LAMP_TRANSFORM node:  [from MOVE_LAMP.translation_changed to set_translation ] -->
               <Transform DEF='LAMP_TRANSFORM'>
 23                      <!-- Note that we are connecting a chain of behavior engines in these ROUTEs. The event types passed via each ROUTE must each match. -->
 24                      < ROUTE  fromNode='MOVE_LAMP' fromField='translation_changed' toNode='LAMP_TRANSFORM' toField='set_translation'/>
 25                      <!-- Now rotate back so that actual geometry remains in original coordinate system -->
 26                      <Transform rotation='1 0 0 -1.57'>
 27                           <Shape>
 28                                <Cylinder height='0.01' radius='0.1'/>
 29                                <Appearance DEF='WHITE'>
 30                                     <Material diffuseColor='.9 .9 .9'/>
 31                                </Appearance>
 32                           </Shape>
 33                           <Group>
 34 
                              <!-- ROUTE information for MOVE_FIRST_ARM node:  [from rotation_changed to FIRST_ARM_TRANSFORM.set_rotation ] -->
                              <SphereSensor DEF='MOVE_FIRST_ARM' description='rotate first arm' offset='1 0 0 -0.7'/>
 35 
                              <!-- ROUTE information for FIRST_ARM_TRANSFORM node:  [from MOVE_FIRST_ARM.rotation_changed to set_rotation ] -->
                              <Transform DEF='FIRST_ARM_TRANSFORM' center='0 -0.15 0' rotation='1 0 0 -0.7' translation='0 0.15 0'>
 36                                     < ROUTE  fromNode='MOVE_FIRST_ARM' fromField='rotation_changed' toNode='FIRST_ARM_TRANSFORM' toField='set_rotation'/>
 37 
                                   <!-- Shape LAMP_ARM is a DEF node that has 1 USE node: USE_1 -->
                                   <Shape DEF='LAMP_ARM'>
 38                                          <Appearance DEF='LIGHT_BROWN'>
 39                                               <Material diffuseColor='.6 .6 .2'/>
 40                                          </Appearance>
 41                                          <Cylinder height='0.3' radius='0.01'/>
 42                                     </Shape>
 43                                     <Group>
 44 
                                        <!-- ROUTE information for MOVE_SECOND_ARM node:  [from rotation_changed to SECOND_ARM_TRANSFORM.set_rotation ] -->
                                        <SphereSensor DEF='MOVE_SECOND_ARM' description='rotate second arm' offset='1 0 0 1.9'/>
 45 
                                        <!-- ROUTE information for SECOND_ARM_TRANSFORM node:  [from MOVE_SECOND_ARM.rotation_changed to set_rotation ] -->
                                        <Transform DEF='SECOND_ARM_TRANSFORM' center='0 -0.15 0' rotation='1 0 0 1.9' translation='0 0.3 0'>
 46                                               < ROUTE  fromNode='MOVE_SECOND_ARM' fromField='rotation_changed' toNode='SECOND_ARM_TRANSFORM' toField='set_rotation'/>
 47                                               <Shape USE='LAMP_ARM'/>
 48                                               <Group>
 49 
                                                  <!-- ROUTE information for MOVE_LAMP_SHADE node:  [from rotation_changed to LAMP_SHADE_TRANSFORM.set_rotation ] -->
                                                  <SphereSensor DEF='MOVE_LAMP_SHADE' description='rotate lamp shade' offset='1 0 0 -1.25'/>
 50 
                                                  <!-- ROUTE information for LAMP_SHADE_TRANSFORM node:  [from MOVE_LAMP_SHADE.rotation_changed to set_rotation ] -->
                                                  <Transform DEF='LAMP_SHADE_TRANSFORM' center='0 0.07 0' rotation='1 0 0 -1.25' translation='0 0.075 0'>
 51                                                         < ROUTE  fromNode='MOVE_LAMP_SHADE' fromField='rotation_changed' toNode='LAMP_SHADE_TRANSFORM' toField='set_rotation'/>
 52                                                         <Shape>
 53                                                              <Appearance>
 54                                                                   <Material diffuseColor='.1 .6 .6'/>
 55                                                              </Appearance>
 56                                                              <Cone bottom='false' bottomRadius='0.12' height='0.15'/>
 57                                                         </Shape>
 58                                                         <Transform translation='0 -0.05 0'>
 59                                                              <Shape>
 60                                                                   <Appearance>
 61                                                                        <Material diffuseColor='.4 .4 .1' emissiveColor='.8 .8 .2'/>
 62                                                                   </Appearance>
 63                                                                   <Sphere radius='0.05'/>
 64                                                              </Shape>
 65                                                              <SpotLight beamWidth='1.570796' color='.8 .8 .1' cutOffAngle='.785398' direction='0 -1 0'/>
 66                                                         </Transform>
 67                                                    </Transform>
 68                                               </Group>
 69                                          </Transform>
 70                                     </Group>
 71                                </Transform>
 72                           </Group>
 73                      </Transform>
 74                 </Transform>
 75            </Transform>
 76            <!-- Adding this Inline reference to another scene superimposes X3D/VRML coordinate system axes. -->
 77            <Transform scale='.25 .25 .25'>
 78  go to online X3D Example Archives model page                <Inline DEF='CoordinateAxes'   url=' "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl"'/>
 79            </Transform>
 80       </Scene>
 81  </X3D>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: 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 node: Viewpoint_1

-->

X3D Tooltips element index: to top Appearance, Cone, Cylinder, Group, head, Inline, Material, meta, PlaneSensor, ROUTE, Scene, Shape, Sphere, SphereSensor, SpotLight, Transform, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

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

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

MOVE_LAMP
PlaneSensor
translation_changed
SFVec3f
→
ROUTE
event to
(1)
LAMP_TRANSFORM
Transform
set_translation
SFVec3f

MOVE_FIRST_ARM
SphereSensor
rotation_changed
SFRotation
→
ROUTE
event to
(1)
FIRST_ARM_TRANSFORM
Transform
set_rotation
SFRotation

MOVE_SECOND_ARM
SphereSensor
rotation_changed
SFRotation
→
ROUTE
event to
(1)
SECOND_ARM_TRANSFORM
Transform
set_rotation
SFRotation

MOVE_LAMP_SHADE
SphereSensor
rotation_changed
SFRotation
→
ROUTE
event to
(1)
LAMP_SHADE_TRANSFORM
Transform
set_rotation
SFRotation

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets.
Have fun with X3D! 😀

-->
go to online X3D Example Archives model page <!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09SensingViewer/Figure09_9DeskLampWithAxesIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09SensingViewer/Figure09_9DeskLampWithAxes.x3d -->

<!-- Color-coding 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. -->