X3D Model Documentation: ImportExportSyntax.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='Immersive' 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=' ImportExportSyntax.x3d '/>
  6            <meta name='creatorcontent='Don Brutzman'/>
  7            <meta name='createdcontent='19 January 2003'/>
  8            <meta name='modifiedcontent='20 October 2019'/>
  9            <meta name='descriptioncontent='Demonstrate IMPORT/EXPORT syntax. Better examples needed, split across 2 files for separate IMPORT and EXPORT.'/>
 10            <meta name=' warning content=' untested in any browser '/>
 11            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/development/ImportExportSyntax.x3d '/>
 12            <meta name='generatorcontent='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 13            <meta name='licensecontent='../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: CLOCK, CoordinateAxes, I1, LocalNavInfo, PI, T1 with IMPORT AS nodes: NewImportedNodeName, I1Root with EXPORT AS nodes: NI, rootTransform
-->
 15       <Scene>
 16            <WorldInfo title='ImportExportSyntax.x3d'/>
 17 
          <!-- This node has an EXPORT connection that can exchange events with a parent X3D model. -->
          <NavigationInfo DEF='LocalNavInfo'/>
 18            <EXPORT localDEF='LocalNavInfoAS='NI'/>
 19            <Transform scale='2 2 2'>
 20                 <!-- the following Inline presumably contains some node with DEF="SomeRemoteNodeNameInsideInlinedScene" -->
 21 
 22                 <IMPORT inlineDEF='CoordinateAxesimportedDEF='SomeRemoteNodeNameInsideInlinedSceneAS='NewImportedNodeName'/>
 23            </Transform>
 24            <!-- ===================== -->
 25            <!-- Abstract spec IMPORT example -->
 26 
          <!-- This node has an IMPORT connection that can exchange events with a child X3D model. -->
          <Inline DEF='I1'   url=' "someUrl.x3d" "http://online.address/someUrl.x3d" '/>
 27 
          <!-- ROUTE information for IMPORT I1Root node:  [from PI.value_changed to I1Root.set_translation ] -->
          <IMPORT inlineDEF='I1importedDEF='rootTransformAS='I1Root'/>
 28 
          <!-- ROUTE information for CLOCK node:  [from fraction_changed to PI.set_fraction ] -->
          <TimeSensor DEF='CLOCK'/>
 29 
          <!-- ROUTE information for PI node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to I1Root.set_translation ] -->
          <PositionInterpolator DEF='PIkey='0 1keyValue='0 0 0 0 0 0'/>
 30            < ROUTE  fromNode='CLOCK' fromField='fraction_changed' toNode='PI' toField='set_fraction'/>
 31            < ROUTE  fromNode='PI' fromField='value_changed' toNode='I1Root' toField='set_translation'/>
 32            <!-- ===================== -->
 33            <!-- Abstract spec EXPORT example -->
 34 
          <!-- This node has an EXPORT connection that can exchange events with a parent X3D model. -->
          <Transform DEF='T1'/>
 35            <EXPORT localDEF='T1AS='rootTransform'/>
 36       </Scene>
 37  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: CLOCK, CoordinateAxes, I1, LocalNavInfo, PI, T1 with IMPORT AS nodes: NewImportedNodeName, I1Root with EXPORT AS nodes: NI, rootTransform
-->
X3D Tooltips element index: EXPORT, head, IMPORT, Inline, meta, NavigationInfo, PositionInterpolator, ROUTE, Scene, TimeSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

ROUTE
event to
(1)
PI
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
PI
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
I1Root
Inline IMPORT
set_translation
SFVec3f

CoordinateAxes
Inline
This node can send or receive ROUTE events via DEF='CoordinateAxes' or via <IMPORT AS='NewImportedNodeName'/> 

I1
Inline
This node can send or receive ROUTE events via DEF='I1' or via <IMPORT AS='I1Root'/> 

line 22
IMPORT
<IMPORT inlineDEF='CoordinateAxes' AS='NewImportedNodeName'/> matches local node
<Inline DEF='CoordinateAxes'/> which can send or receive events between different X3D models,
if this parent model has ROUTE statements to exchange events with the child Inline model. 

line 27
IMPORT
<IMPORT inlineDEF='I1' AS='I1Root'/> matches local node
<Inline DEF='I1'/> which can send or receive events between different X3D models,
if this parent model has ROUTE statements to exchange events with the child Inline model. 

line 18
EXPORT
<EXPORT localDEF='LocalNavInfo' AS='NI'/> matches local node
<NavigationInfo DEF='LocalNavInfo'/> which can send or receive events,
if a parent X3D model loads this scene via Inline/IMPORT
and then uses ROUTE statements to exchange events with it. 

line 35
EXPORT
<EXPORT localDEF='T1' AS='rootTransform'/> matches local node
<Transform DEF='T1'/> which can send or receive events,
if a parent X3D model loads this scene via Inline/IMPORT
and then uses ROUTE statements to exchange events with it. 

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/Basic/development/ImportExportSyntaxIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/ImportExportSyntax.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='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. -->