X3D Model Documentation: InlineExport.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='InlineExport.x3d'/>
  6            <meta name='descriptioncontent='X3D encodings example: demonstrate reuse and adaptation of content instances through Inline IMPORT, EXPORT statements. This scene does not animate, see InlineImport.x3d for selective animation of scene subgraph EXPORT localDEF=T1 AS=RootTransform'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='27 May 2024'/>
  9            <meta name='modifiedcontent='19 January 2025'/>
 10            <meta name='Imagecontent='InlineImportInlineExportAnimation.png'/>
 11            <meta name='drawingcontent='InlineImportInlineExportAnimation.vsdx'/>
 12            <meta name='Imagecontent='InlineExport.png'/>
 13            <meta name='referencecontent='InlineImport.x3d'/>
 14            <meta name='specificationSectioncontent='X3D Architecture version 4.0 ISO/IEC 19775-1, clause 4 Concepts, 4.4.6 Import/Export semantics'/>
 15            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#ImportExportsemantics'/>
 16            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-1, Part 1: XML encoding, clause 4.3.2.6 EXPORT/IMPORT statement syntax'/>
 17            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#EXPORT_IMPORT_StatementSyntax'/>
 18            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-2, Part 1: ClassicVRML encoding, clause 4.3.2.6 EXPORT/IMPORT statement syntax'/>
 19            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-2v4.0-WD1/Part02/concepts.html#EXPORT_IMPORT_StatementSyntax'/>
 20            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 21            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineExport.x3d'/>
 22            <meta name='licensecontent='../license.html'/>
 23       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: SmallerSphere, T1, T2 with EXPORT AS node: RootTransform
-->
 24       <Scene>
 25            <WorldInfo title='InlineExport.x3d'/>
 26            <Background skyColor='0.8 0.8 0.8'/>
 27 
          <!-- This node has an EXPORT connection that can exchange events with a parent X3D model. -->
          <Transform DEF='T1translation='0 1 0'>
 28                 <Shape>
 29                      <Box/>
 30                      <Appearance>
 31                           <Material diffuseColor='0.8 0.8 0.2'/>
 32                      </Appearance>
 33                 </Shape>
 34                 <Transform translation='2 0 0'>
 35 
                    <!-- Shape SmallerSphere is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='SmallerSphere'>
 36                           <Sphere radius='0.2'/>
 37                           <Appearance>
 38                                <Material diffuseColor='0.2 0.8 0.8'/>
 39                           </Appearance>
 40                      </Shape>
 41                 </Transform>
 42                 <Transform translation='-2 0 0'>
 43                      <Shape USE='SmallerSphere'/>
 44                 </Transform>
 45            </Transform>
 46            <!-- Hint: EXPORT statement must follow the DEF node of interest, since localDEF field is similar to USE (with data type IDREF). -->
 47            <!-- Hint: EXPORT localDEF is DEF name within this model, AS is the name exposed to an external Inline IMPORT statement. -->
 48            <EXPORT localDEF='T1AS='RootTransform'/>
 49            <Transform DEF='T2translation='0 -2 0'>
 50                 <Shape>
 51                      <Text string=' "Shapes can rotate if" "animation events are sent" "via Inline IMPORT/EXPORT" '>
 52                           <FontStyle family='"SANS"justify='"MIDDLE" "MIDDLE"size='0.6style='BOLD'/>
 53                      </Text>
 54                      <Appearance>
 55                           <Material diffuseColor='0.2 0.2 0.7'/>
 56                      </Appearance>
 57                 </Shape>
 58            </Transform>
 59       </Scene>
 60  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: SmallerSphere, T1, T2 with EXPORT AS node: RootTransform
-->
X3D Tooltips element index: Appearance, Background, Box, EXPORT, FontStyle, head, Material, meta, Scene, Shape, Sphere, Text, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table with 0 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.

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