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='A3_GeoInline.x3d'/> |
6 | <meta name='creator' content='Martin Reddy SRI, original example'/> |
7 | <meta name='creator' content='Don Brutzman NPS, X3D encoding'/> |
8 | <meta name='created' content='26 June 2000'/> |
9 | <meta name='modified' content='17 June 2020'/> |
10 | <meta name='description' content='Specification example: on-demand inlining via GeoInline for scene resource management.'/> |
11 | <meta name=' warning ' content=' GeoVRML 1.1 GeoInline functionality is embedded in X3D Inline node, GeoInline no longer supported in X3D. '/> |
12 | <meta name='reference' content='http://www.geovrml.org/1.0/doc/examples.html'/> |
13 | <meta name='reference' content='originals/geoinlineTest.wrl'/> |
14 | <meta name='reference' content='VRML 97 encoding http://www.geovrml.org/1.0/doc/examples/geoinline.wrl'/> |
15 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/Geospatial/A3_GeoInline.x3d'/> |
16 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
17 | <meta name='license' content='../license.html'/> |
18 | </head> |
19 | <Scene> |
20 | <WorldInfo title='A3_GeoInline.x3d'/> |
21 | <Group> |
22 | <!-- Original GeoVRML GeoInline node replaced by improved X3D Inline node --> |
23 |
<!-- ROUTE information for TestInline node:
[from ReturnTrue.value_changed to set_load
]
[from ReturnFalse.value_changed to set_load
]
-->
<Inline DEF='TestInline' load='false' url=' "BoxSimple.x3d" "https://www.web3d.org/x3d/content/examples/Basic/Geospatial/BoxSimple.x3d" "BoxSimple.wrl" "https://www.web3d.org/x3d/content/examples/Basic/Geospatial/BoxSimple.wrl" '/> |
24 | <!-- don't load TestInline until 'true' event sent --> |
25 | </Group> |
26 | <!-- Two cones that are used to load and unload the URL for the box --> |
27 | <Transform scale='0.5 0.5 0.5' translation='2 1.0 0'> |
28 |
<!-- ROUTE information for LoadTrigger node:
[from isActive to ReturnTrue.set_value
]
-->
<TouchSensor DEF='LoadTrigger' description='click to load inlined Box'/> |
29 | <Shape> |
30 | <Appearance> |
31 | <Material diffuseColor='1 0 0'/> |
32 | </Appearance> |
33 | <Cone/> |
34 | </Shape> |
35 | </Transform> |
36 | <Transform scale='0.5 0.5 0.5' translation='1.5 1.2 0.3'> |
37 | <Shape> |
38 | <Text length='0' string='"Load Cube"'> |
39 | <FontStyle/> |
40 | </Text> |
41 | <Appearance> |
42 | <Material diffuseColor='0 0.6 0.3'/> |
43 | </Appearance> |
44 | </Shape> |
45 | </Transform> |
46 | <Transform rotation='1 0 0 3.1415' scale='0.5 0.5 0.5' translation='2 -1.0 0'> |
47 |
<!-- ROUTE information for UnLoadTrigger node:
[from isActive to ReturnFalse.set_value
]
-->
<TouchSensor DEF='UnLoadTrigger' description='click to unload inlined Box'/> |
48 | <Shape> |
49 | <Appearance> |
50 | <Material diffuseColor='0 0 1'/> |
51 | </Appearance> |
52 | <Cone/> |
53 | </Shape> |
54 | </Transform> |
55 | <Transform scale='0.5 0.5 0.5' translation='1.5 -1.5 0.3'> |
56 | <Shape> |
57 | <Text length='0' string='"Unload Cube"'> |
58 | <FontStyle/> |
59 | </Text> |
60 | <Appearance> |
61 | <Material diffuseColor='0.6 0.3 0'/> |
62 | </Appearance> |
63 | </Shape> |
64 | </Transform> |
65 | <!-- a couple of scripts to process the events from clicking on the cones --> |
66 |
<!-- ROUTE information for ReturnTrue node:
[from LoadTrigger.isActive to set_value
]
[from value_changed to TestInline.set_load
]
-->
<Script DEF='ReturnTrue'> |
67 | <field name='set_value' type='SFBool' accessType='inputOnly'/> |
68 | <field name='value_changed' type='SFBool' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function set_value( value ) { if ( value == true ) value_changed = true; }
]]>
|
|
70 | </Script> |
71 |
<!-- ROUTE information for ReturnFalse node:
[from UnLoadTrigger.isActive to set_value
]
[from value_changed to TestInline.set_load
]
-->
<Script DEF='ReturnFalse'> |
72 | <field name='set_value' type='SFBool' accessType='inputOnly'/> |
73 | <field name='value_changed' type='SFBool' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function set_value( value ) { if ( value == true ) value_changed = false; }
]]>
|
|
75 | </Script> |
76 | < ROUTE fromNode='LoadTrigger' fromField='isActive' toNode='ReturnTrue' toField='set_value'/> |
77 | < ROUTE fromNode='ReturnTrue' fromField='value_changed' toNode='TestInline' toField='set_load'/> |
78 | < ROUTE fromNode='UnLoadTrigger' fromField='isActive' toNode='ReturnFalse' toField='set_value'/> |
79 | < ROUTE fromNode='ReturnFalse' fromField='value_changed' toNode='TestInline' toField='set_load'/> |
80 | </Scene> |
81 | </X3D> |
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.
LoadTrigger
TouchSensor isActive SFBool |
ReturnTrue
Script set_value SFBool |
then
|
ReturnTrue
Script value_changed SFBool |
TestInline
Inline set_load SFBool |
UnLoadTrigger
TouchSensor isActive SFBool |
ReturnFalse
Script set_value SFBool |
then
|
ReturnFalse
Script value_changed SFBool |
TestInline
Inline set_load SFBool |
<!--
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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->