| 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='title' content=' Figure10_07LightBulb.x3d '/> |
| 6 | <meta name='creator' content='Figure 10.7, 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/ch10/10fig07.htm '/> |
| 8 | <meta name='translator' content='Don Brutzman'/> |
| 9 | <meta name='created' content='15 August 2000'/> |
| 10 | <meta name='modified' content='20 October 2019'/> |
| 11 | <meta name='description' content='A lightbulb that varies in brightness as the pointing device is held over the socket.'/> |
| 12 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter10Materials/Figure10_07LightBulb.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> |
| 16 | <Scene> |
| 17 | <WorldInfo title='Figure10_07LightBulb.x3d'/> |
| 18 | <Viewpoint description='Light bulb: put mouse over socket to change brightness' position='0 0 8'/> |
| 19 | <Transform translation='0 2 0'> |
| 20 | <Shape> |
| 21 | <Appearance> |
| 22 | <Material diffuseColor='0.4 0.4 0.4' emissiveColor='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_MATERIAL' diffuseColor='0.4 0.4 0.16' emissiveColor='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='1' radius='0.5'/> |
| 39 | </Shape> |
| 40 | </Transform> |
| 41 |
<!-- ROUTE information for SOCKET_TOUCHSENSOR node:
[from isOver to LIGHT_TIMESENSOR.enabled
]
-->
<TouchSensor DEF='SOCKET_TOUCHSENSOR' description='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_MATERIAL' diffuseColor='0.4 0.4 0.4' emissiveColor='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_TIMESENSOR' cycleInterval='3' enabled='false' loop='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_COLORINTERPOLATOR' key='0 0.1 0.4 0.6 0.9 1' keyValue='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 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 |
LIGHT_TIMESENSOR
TimeSensor enabled SFBool |
then
|
LIGHT_TIMESENSOR
TimeSensor fraction_changed SFFloat |
WHITE_COLORINTERPOLATOR
ColorInterpolator set_fraction SFFloat |
then
|
WHITE_COLORINTERPOLATOR
ColorInterpolator value_changed SFColor |
BULB_MATERIAL
Material set_diffuseColor SFColor |
|||
|
then
|
WHITE_COLORINTERPOLATOR
ColorInterpolator value_changed SFColor |
BULB_MATERIAL
Material set_emissiveColor SFColor |
||||||||
|
then
|
WHITE_COLORINTERPOLATOR
ColorInterpolator value_changed SFColor |
LIGHTSOURCE
PointLight set_color SFColor |
||||||||
<!--
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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->