X3D Model Documentation: Figure10_07LightBulb.x3d

  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='Interactive' 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='titlecontent='Figure10_07LightBulb.x3d'/>
  6            <meta name='creatorcontent='Figure 10.7, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch10/10fig07.htm'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='15 August 2000'/>
 10            <meta name='modifiedcontent='20 October 2019'/>
 11            <meta name='descriptioncontent='A lightbulb that varies in brightness as the pointing device is held over the socket.'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter10Materials/Figure10_07LightBulb.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BULB_CASING, BULB_MATERIAL, LIGHT_TIMESENSOR, LIGHTSOURCE, SOCKET_MATERIAL, SOCKET_TOUCHSENSOR, WHITE_COLORINTERPOLATOR

Index for Viewpoint node: Viewpoint_1
-->
 16       <Scene>
 17            <WorldInfo title='Figure10_07LightBulb.x3d'/>
 18            <Viewpoint description='Light bulb: put mouse over socket to change brightnessposition='0 0 8'/>
 19            <Transform translation='0 2 0'>
 20                 <Shape>
 21                      <Appearance>
 22                           <Material diffuseColor='0.4 0.4 0.4emissiveColor='0.1 0.1 0.1'/>
 23                      </Appearance>
 24                      <Cylinder radius='0.05'/>
 25                 </Shape>
 26                 <Group>
 27                      <Transform translation='0 -1 0'>
 28                           <Shape>
 29 
                              <!-- Appearance BULB_CASING is a DEF node that has 1 USE node: USE_1 -->
                              <Appearance DEF='BULB_CASING'>
 30                                     <Material DEF='SOCKET_MATERIALdiffuseColor='0.4 0.4 0.16emissiveColor='0.4 0.4 0.16'/>
 31                                </Appearance>
 32                                <Sphere radius='0.5'/>
 33                           </Shape>
 34                      </Transform>
 35                      <Transform translation='0 -1.5 0'>
 36                           <Shape>
 37                                <Appearance USE='BULB_CASING'/>
 38                                <Cylinder height='1radius='0.5'/>
 39                           </Shape>
 40                      </Transform>
 41 
                    <!-- ROUTE information for SOCKET_TOUCHSENSOR node:  [from isOver to LIGHT_TIMESENSOR.enabled ] -->
                    <TouchSensor DEF='SOCKET_TOUCHSENSORdescription='touch to change light intensity'/>
 42                 </Group>
 43                 <Transform translation='0 -2.95 0'>
 44                      <Shape>
 45                           <Appearance>
 46 
                              <!-- ROUTE information for BULB_MATERIAL node:  [from WHITE_COLORINTERPOLATOR.value_changed to set_diffuseColor ] [from WHITE_COLORINTERPOLATOR.value_changed to set_emissiveColor ] -->
                              <Material DEF='BULB_MATERIALdiffuseColor='0.4 0.4 0.4emissiveColor='0.8 0.8 0.8'/>
 47                           </Appearance>
 48                           <Sphere/>
 49                      </Shape>
 50 
                    <!-- ROUTE information for LIGHTSOURCE node:  [from WHITE_COLORINTERPOLATOR.value_changed to set_color ] -->
                    <PointLight DEF='LIGHTSOURCE'/>
 51                 </Transform>
 52            </Transform>
 53 
          <!-- ROUTE information for LIGHT_TIMESENSOR node:  [from SOCKET_TOUCHSENSOR.isOver to enabled ] [from fraction_changed to WHITE_COLORINTERPOLATOR.set_fraction ] -->
          <TimeSensor DEF='LIGHT_TIMESENSORcycleInterval='3enabled='falseloop='true'/>
 54 
          <!-- ROUTE information for WHITE_COLORINTERPOLATOR node:  [from LIGHT_TIMESENSOR.fraction_changed to set_fraction ] [from value_changed to BULB_MATERIAL.set_diffuseColor ] [from value_changed to BULB_MATERIAL.set_emissiveColor ] [from value_changed to LIGHTSOURCE.set_color ] -->
          <ColorInterpolator DEF='WHITE_COLORINTERPOLATORkey='0 0.1 0.4 0.6 0.9 1keyValue='1 1 1 1 1 1 0.1 0.1 0.1 0.1 0.1 0.1 1 1 1 1 1 1'/>
 55            < ROUTE  fromNode='SOCKET_TOUCHSENSOR' fromField='isOver' toNode='LIGHT_TIMESENSOR' toField='enabled'/>
 56            < ROUTE  fromNode='LIGHT_TIMESENSOR' fromField='fraction_changed' toNode='WHITE_COLORINTERPOLATOR' toField='set_fraction'/>
 57            < ROUTE  fromNode='WHITE_COLORINTERPOLATOR' fromField='value_changed' toNode='BULB_MATERIAL' toField='set_diffuseColor'/>
 58            < ROUTE  fromNode='WHITE_COLORINTERPOLATOR' fromField='value_changed' toNode='BULB_MATERIAL' toField='set_emissiveColor'/>
 59            < ROUTE  fromNode='WHITE_COLORINTERPOLATOR' fromField='value_changed' toNode='LIGHTSOURCE' toField='set_color'/>
 60       </Scene>
 61  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BULB_CASING, BULB_MATERIAL, LIGHT_TIMESENSOR, LIGHTSOURCE, SOCKET_MATERIAL, SOCKET_TOUCHSENSOR, WHITE_COLORINTERPOLATOR

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, ColorInterpolator, Cylinder, Group, head, Material, meta, PointLight, ROUTE, Scene, Shape, Sphere, TimeSensor, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 5 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.

SOCKET_TOUCHSENSOR
TouchSensor
isOver
SFBool

ROUTE
event to
(1)
LIGHT_TIMESENSOR
TimeSensor
enabled
SFBool
then
 
 
 
LIGHT_TIMESENSOR
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
WHITE_COLORINTERPOLATOR
ColorInterpolator
set_fraction
SFFloat
then
 
 
 
WHITE_COLORINTERPOLATOR
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(3)
BULB_MATERIAL
Material
set_diffuseColor
SFColor
  then
 
 
 
WHITE_COLORINTERPOLATOR
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(3)
BULB_MATERIAL
Material
set_emissiveColor
SFColor
  then
 
 
 
WHITE_COLORINTERPOLATOR
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(3)
LIGHTSOURCE
PointLight
set_color
SFColor

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

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter10Materials/Figure10_07LightBulbIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter10Materials/Figure10_07LightBulb.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. -->