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 | <component level='1' name='Geospatial'/> |
6 | <component level='2' name='NURBS'/> |
7 | <component level='2' name='Core'/> |
8 | <component level='1' name='Navigation'/> |
9 | <!-- test no warning for overloaded component names --> |
10 | <component level='1' name='Text'/> |
11 | <component level='1' name='Sound'/> |
12 | <meta name='title' content='X3dHeaderPrototypeSyntaxExamples.x3d'/> |
13 | <meta name='description' content='X3D scene header and prototype syntax examples. This example header indicates that the content is XML encoded, follows the Interactive Profile and explicitly lists additional necessary components. The X3D header may also contain additional semantic information. Used for specification EXAMPLE excerpts in 19776:1 XML Encoding.'/> |
14 | <meta name='created' content='14 October 2002'/> |
15 | <meta name='modified' content='28 January 2024'/> |
16 | <meta name='creator' content='Don Brutzman'/> |
17 | <meta name='specificationSection' content='X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax'/> |
18 | <meta name='specificationUrl' content='https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#XMLFileSyntax'/> |
19 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamples.x3d'/> |
20 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
21 | <meta name='license' content='../license.html'/> |
22 | </head> |
23 | <Scene> |
24 | <ExternProtoDeclare name='ViewPositionOrientation' url=' "../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" '> |
25 | <field name='enabled' type='SFBool' accessType='inputOutput'/> |
26 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
27 | <field name='set_traceEnabled' type='SFBool' accessType='inputOnly'/> |
28 | <field name='position_changed' type='SFVec3f' accessType='outputOnly'/> |
29 | <field name='orientation_changed' type='SFRotation' accessType='outputOnly'/> |
30 | <field name='outputViewpointString' type='MFString' accessType='outputOnly'/> |
31 | </ExternProtoDeclare> |
32 | <ProtoDeclare name='NewWorldInfoNode'> |
33 | <ProtoBody> |
34 | <WorldInfo DEF='ExamplePrototypeBody'/> |
35 | </ProtoBody> |
36 | </ProtoDeclare> |
37 | <ProtoInstance name='NewWorldInfoNode'/> |
38 | <ProtoDeclare name='EmissiveMaterial'> |
39 | <ProtoInterface> |
40 | <field name='onlyColor' type='SFColor' value='1 0 0' accessType='inputOutput'/> |
41 | </ProtoInterface> |
42 | <ProtoBody> |
43 | <!-- Override default diffuseColor value 0.8 0.8 0.8 --> |
44 | <Material diffuseColor='0 0 0'> |
45 | <!-- Connect emissiveColor field of current node to onlyColor field of parent ProtoDeclare. --> |
46 | <IS> |
47 | <connect nodeField='emissiveColor' protoField='onlyColor'/> |
48 | </IS> |
49 | </Material> |
50 | </ProtoBody> |
51 | </ProtoDeclare> |
52 | <ProtoDeclare name='ShiftGroupUp2m'> |
53 | <ProtoInterface> |
54 | <field name='children' type='MFNode' accessType='inputOutput'> |
55 | <Group DEF='DefaultNodeValue' bboxSize='2 2 2'> |
56 | <!-- Authors need to override this node when creating the ProtoInstance fieldValue name="children" --> |
57 | </Group> |
58 | </field> |
59 | </ProtoInterface> |
60 | <ProtoBody> |
61 | <Transform translation='0 2 0'> |
62 | <Group> |
63 | <IS> |
64 | <connect nodeField='children' protoField='children'/> |
65 | </IS> |
66 | </Group> |
67 | </Transform> |
68 | </ProtoBody> |
69 | </ProtoDeclare> |
70 | <ProtoInstance name='ShiftGroupUp2m'/> |
71 | <!-- ==================== --> |
72 | <Viewpoint DEF='ExampleSingleElement' description='Hello syntax'/> |
73 |
<!-- Group
ExampleChildElement is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
<Group DEF='ExampleChildElement'> |
74 | <Shape> |
75 | <Box/> |
76 | <Appearance> |
77 | <Material diffuseColor='0.6 0.4 0.2'/> |
78 | </Appearance> |
79 | </Shape> |
80 | </Group> |
81 |
<!-- ROUTE information for TransformExampleUSE node:
[from Spinner.value_changed to rotation
]
-->
<Transform DEF='TransformExampleUSE' rotation='0 1 0 0.78' translation='0 2.5 0'> |
82 | <Group USE='ExampleChildElement'/> |
83 | </Transform> |
84 | <Collision> |
85 | <Shape containerField='proxy'> |
86 | <!-- note that Collision proxy Shape is not rendered --> |
87 | <Sphere/> |
88 | <Appearance> |
89 | <Material/> |
90 | </Appearance> |
91 | </Shape> |
92 | <Group USE='ExampleChildElement'/> |
93 | </Collision> |
94 | <Transform translation='0 -2.5 0'> |
95 | <Shape> |
96 | <Appearance> |
97 | <ProtoInstance name='EmissiveMaterial' containerField='material'> |
98 | <fieldValue name='onlyColor' value='0.2 0.6 0.6'/> |
99 | </ProtoInstance> |
100 | </Appearance> |
101 | <Text string='"X3D Header Prototype syntax examples" "(view console for EXTERNPROTO output)"'> |
102 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.6'/> |
103 | </Text> |
104 | </Shape> |
105 | </Transform> |
106 | <ProtoInstance name='ViewPositionOrientation' DEF='ConsoleOutputViewPositionOrientation'> |
107 | <fieldValue name='enabled' value='true'/> |
108 | </ProtoInstance> |
109 |
<!-- ROUTE information for Clock node:
[from fraction_changed to Spinner.set_fraction
]
[from fraction_changed to StayInPlace.set_fraction
]
-->
<TimeSensor DEF='Clock' cycleInterval='4' loop='true'/> |
110 |
<!-- ROUTE information for Spinner node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to TransformExampleUSE.rotation
]
-->
<OrientationInterpolator DEF='Spinner' key='0 0.5 1' keyValue='0 1 0 0 0 1 0 3.14159 0 1 0 6.28318'/> |
111 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='Spinner' toField='set_fraction'/> |
112 | < ROUTE fromNode='Spinner' fromField='value_changed' toNode='TransformExampleUSE' toField='rotation'/> |
113 | <Inline DEF='someInline' url=' "someUrl.x3d" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/someUrl.x3d" '/> |
114 |
<!-- ROUTE information for IMPORT someInlineRoot node:
[from StayInPlace.value_changed to someInlineRoot.set_translation
]
-->
<IMPORT inlineDEF='someInline' importedDEF='someName' AS='someInlineRoot'/> |
115 |
<!-- ROUTE information for StayInPlace node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to someInlineRoot.set_translation
]
-->
<PositionInterpolator DEF='StayInPlace' key='0 1' keyValue='0 0 0 0 0 0'/> |
116 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='StayInPlace' toField='set_fraction'/> |
117 | < ROUTE fromNode='StayInPlace' fromField='value_changed' toNode='someInlineRoot' toField='set_translation'/> |
118 | </Scene> |
119 | </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.
Clock
TimeSensor fraction_changed SFFloat |
Spinner
OrientationInterpolator set_fraction SFFloat |
then
|
Spinner
OrientationInterpolator value_changed SFRotation |
TransformExampleUSE
Transform rotation SFRotation |
||
Clock
TimeSensor fraction_changed SFFloat |
StayInPlace
PositionInterpolator set_fraction SFFloat |
then
|
StayInPlace
PositionInterpolator value_changed SFVec3f |
someInlineRoot
Inline IMPORT set_translation SFVec3f |
ProtoInstance NewWorldInfoNode |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
ProtoInstance ShiftGroupUp2m |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
ProtoInstance EmissiveMaterial |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
ConsoleOutputViewPositionOrientation
ProtoInstance ViewPositionOrientation |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
<!--
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)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->