1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
4 | <head> |
5 | <meta name='title' content='LoadSensorExample.x3d'/> |
6 | <meta name='description' content='Simple test of LoadSensor node'/> |
7 | <meta name='creator' content='Don Brutzman'/> |
8 | <meta name='created' content='17 July 2008'/> |
9 | <meta name='modified' content='27 July 2024'/> |
10 | <meta name='rights' content='Copyright Don Brutzman and Leonard Daly 2008'/> |
11 | <meta name='subject' content='X3D LoadSensor example'/> |
12 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/LoadSensorExample.x3d'/> |
13 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
14 | <meta name='license' content='../license.html'/> |
15 | </head> |
16 | <Scene> |
17 | <WorldInfo title='LoadSensorExample.x3d'/> |
18 | <Viewpoint DEF='ViewAll' description='LoadSensor test' position='0 0 12'/> |
19 |
<!-- Inline
HelloWorld is a DEF node that has 1 USE node: USE_1 --> <Inline DEF='HelloWorld' url=' "../HelloWorld.x3d" "https://www.web3d.org/x3d/content/examples/HelloWorld.x3d" '/> |
20 |
<!-- ROUTE information for InlineLoadSensor node:
[from loadTime to SignRotationClock.set_startTime
]
[from isLoaded to TraceScript.eventLoaded
]
[from loadTime to TraceScript.loadTimeEvent
]
-->
<LoadSensor DEF='InlineLoadSensor' timeOut='5'> |
21 | <Inline USE='HelloWorld' containerField='watchList'/> |
22 | </LoadSensor> |
23 |
<!-- ROUTE information for PivotTextSigns node:
[from SignRotationInterpolator.value_changed to set_rotation
]
-->
<Transform DEF='PivotTextSigns' translation='0 3 0'> |
24 | <!-- First sign indicates waiting... --> |
25 | <Shape> |
26 | <Text length='0' string='"LoadSensor waiting for HelloWorld scene..."'> |
27 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.7' style='ITALIC'/> |
28 | </Text> |
29 | <Appearance> |
30 | <Material emissiveColor='0.878431 0.262745 0'/> |
31 | </Appearance> |
32 | </Shape> |
33 | <!-- Second sign indicates completed, initially rotated 90 degrees out of view --> |
34 | <Transform rotation='0 1 0 1.57'> |
35 | <Shape> |
36 | <Text length='0' string='"LoadSensor reports HelloWorld scene loading complete."'> |
37 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.7' style='ITALIC'/> |
38 | </Text> |
39 | <Appearance> |
40 | <Material emissiveColor='0 0.278431 0.027451'/> |
41 | </Appearance> |
42 | </Shape> |
43 | </Transform> |
44 | </Transform> |
45 |
<!-- ROUTE information for SignRotationInterpolator node:
[from SignRotationClock.fraction_changed to set_fraction
]
[from value_changed to PivotTextSigns.set_rotation
]
-->
<OrientationInterpolator DEF='SignRotationInterpolator' key='0 1' keyValue='0 1 0 0 0 1 0 -1.57'/> |
46 |
<!-- ROUTE information for SignRotationClock node:
[from InlineLoadSensor.loadTime to set_startTime
]
[from fraction_changed to SignRotationInterpolator.set_fraction
]
-->
<TimeSensor DEF='SignRotationClock' cycleInterval='0.8'/> |
47 | < ROUTE fromNode='InlineLoadSensor' fromField='loadTime' toNode='SignRotationClock' toField='set_startTime'/> |
48 | < ROUTE fromNode='SignRotationClock' fromField='fraction_changed' toNode='SignRotationInterpolator' toField='set_fraction'/> |
49 | < ROUTE fromNode='SignRotationInterpolator' fromField='value_changed' toNode='PivotTextSigns' toField='set_rotation'/> |
50 |
<!-- ROUTE information for TraceScript node:
[from InlineLoadSensor.isLoaded to eventLoaded
]
[from InlineLoadSensor.loadTime to loadTimeEvent
]
-->
<Script DEF='TraceScript'> |
51 | <field name='eventLoaded' type='SFBool' accessType='inputOnly'/> |
52 | <field name='loadTimeEvent' type='SFTime' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function eventLoaded (value) { Browser.println ('InlineLoadSensor isLoaded=' + value); } function loadTimeEvent (value) { Browser.println ('InlineLoadSensor loadTime=' + value); }
]]>
|
|
54 | </Script> |
55 | < ROUTE fromNode='InlineLoadSensor' fromField='isLoaded' toNode='TraceScript' toField='eventLoaded'/> |
56 | < ROUTE fromNode='InlineLoadSensor' fromField='loadTime' toNode='TraceScript' toField='loadTimeEvent'/> |
57 | </Scene> |
58 | </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.
InlineLoadSensor
LoadSensor loadTime SFTime |
SignRotationClock
TimeSensor set_startTime SFTime |
then
|
SignRotationClock
TimeSensor fraction_changed SFFloat |
SignRotationInterpolator
OrientationInterpolator set_fraction SFFloat |
then
|
SignRotationInterpolator
OrientationInterpolator value_changed SFRotation |
PivotTextSigns
Transform set_rotation SFRotation |
InlineLoadSensor
LoadSensor isLoaded SFBool |
TraceScript
Script eventLoaded SFBool |
|
InlineLoadSensor
LoadSensor loadTime SFTime |
TraceScript
Script loadTimeEvent SFTime |
<!--
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. -->