X3D Model Documentation: InlineImport.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
  3  <X3D profile='Immersive' version='4.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='InlineImport.x3d'/>
  6            <meta name='descriptioncontent='X3D encodings example: demonstrate reuse and adaptation of content instances through Inline IMPORT, EXPORT statements.'/>
  7            <meta name='infocontent='The exchange of events can be passed not only from parent Inline to contained model, but also from child to parent, and to external HTML5 web pages as well. If authors and model libraries use consistent naming conventions for EXPORT of exposed nodes, this extensibility enables large-scale composition of X3D worlds containing consistently animatable models. Applying this design pattern in concert with naming conventions and metadata vocabularies holds excellent potential for use in Smart City visualization.'/>
  8            <meta name='creatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='27 May 2024'/>
 10            <meta name='modifiedcontent='17 August 2024'/>
 11            <meta name='Imagecontent='InlineImportX_ITE.png'/>
 12            <meta name='Imagecontent='InlineImportX3DOM.png'/>
 13            <meta name='Imagecontent='InlineImportX_ITE.png'/>
 14            <meta name='Imagecontent='InlineImportCastleModelViewer.png'/>
 15            <meta name='Imagecontent='InlineImportInlineExportAnimation.png'/>
 16            <meta name='drawingcontent='InlineImportInlineExportAnimation.vsdx'/>
 17            <meta name='referencecontent='InlineExport.x3d'/>
 18            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-1.4, Part 1: XML encoding, clause 4.3.12 IMPORT/EXPORT statement syntax'/>
 19            <meta name='specificationUrlcontent='https://web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#IMPORT_EXPORTStatementSyntax'/>
 20            <meta name='specificationSectioncontent='X3D Architecture version 4.0 ISO/IEC 19775-1, clause 4 Concepts, 4.4.6 Import/Export semantics'/>
 21            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#ImportExportsemantics'/>
 22            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineImport.x3d'/>
 23            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 24            <meta name='licensecontent='../license.html'/>
 25       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: MyInlineModel, MySpinner, SpinClock with IMPORT AS node: MyInlineRootTransform
-->
 26       <Scene>
 27            <WorldInfo title='InlineImport.x3d'/>
 28            <Background skyColor='1 1 1'/>
 29            <Inline DEF='MyInlineModeldescription='Load model that provides external access to a node via an EXPORT statement, accessed by IMPORT statement in this model'   url=' "InlineExport.x3d" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineExport.x3d" "InlineExport.wrl" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineExport.wrl" '>
 30                 <MetadataString containerField='metadataname='profilevalue='"Immersive"'/>
 31            </Inline>
 32            <!-- Hint: when using IMPORT statement, the author must keep track of correct node type for importedDEF node within the external Inline scene, otherwise a runtime error can occur in this scene. -->
 33            <!-- Hint: IMPORT inlineDEF is DEF name of Inline node in this scene. -->
 34            <!-- Hint: importedDEF is DEF name exported by the external model, AS is the exposed DEF name in this scene. -->
 35 
          <!-- ROUTE information for IMPORT MyInlineRootTransform node:  [from MySpinner.value_changed to MyInlineRootTransform.set_rotation ] -->
          <IMPORT inlineDEF='MyInlineModelimportedDEF='RootTransformAS='MyInlineRootTransform'/>
 36 
          <!-- ROUTE information for MySpinner node:  [from SpinClock.fraction_changed to set_fraction ] [from value_changed to MyInlineRootTransform.set_rotation ] -->
          <OrientationInterpolator DEF='MySpinnerkey='0 0.3333 0.6667 1keyValue='0 1 0 0 0 1 0 2.094395 0 1 0 4.18879 0 1 0 0'/>
 37            < ROUTE  fromNode='MySpinner' fromField='value_changed' toNode='MyInlineRootTransform' toField='set_rotation'/>
 38 
          <!-- ROUTE information for SpinClock node:  [from fraction_changed to MySpinner.set_fraction ] -->
          <TimeSensor DEF='SpinClockcycleInterval='8loop='true'/>
 39            < ROUTE  fromNode='SpinClock' fromField='fraction_changed' toNode='MySpinner' toField='set_fraction'/>
 40       </Scene>
 41  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: MyInlineModel, MySpinner, SpinClock with IMPORT AS node: MyInlineRootTransform
-->
X3D Tooltips element index: Background, head, IMPORT, Inline, meta, MetadataString, OrientationInterpolator, ROUTE, Scene, TimeSensor, WorldInfo, X3D, accessType and type, XML data types, 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.

SpinClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
MySpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
MySpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
MyInlineRootTransform
Inline IMPORT
set_rotation
SFRotation

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

<!-- 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)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->