X3D Model Documentation: X3dArchitectureConceptsPrototypeBodyValidationExample.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='X3dArchitectureConceptsPrototypeBodyValidationExample.x3d'/>
  6            <meta name='descriptioncontent='Prototype example to illustrate why additional non-rendering nodes might be needed after first node in ProtoBody'/>
  7            <meta name='creatorcontent='*Don Brutzman'/>
  8            <meta name='createdcontent='10 September 2021'/>
  9            <meta name='versioncontent='19 September 2021'/>
 10            <meta name='drawingcontent='X3dArchitectureConceptsPrototypeBodyValidationDiagram.png'/>
 11            <meta name='drawingcontent='X3dArchitectureConceptsPrototypeBodyValidationDiagram.vsdx'/>
 12            <meta name='Imagecontent='X3dArchitectureConceptsPrototypeBodyValidationExampleX_ITE.png'/>
 13            <meta name='referencecontent='https://www.web3d.org/member-only/mantis/view.php?id=1372'/>
 14            <meta name='specificationSectioncontent='X3D Architecture, ISO/IEC 19775-1: 202x, Clause 4 Concepts, 4.4.4.3 PROTO definition semantics'/>
 15            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#PROTOdefinitionsemantics'/>
 16            <meta name='rightscontent='(c) Web3D Consortium Inc. 2021'/>
 17            <meta name='subjectcontent='X3D prototype specification'/>
 18            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/X3dArchitectureConceptsPrototypeBodyValidationExample.x3d'/>
 19            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 20            <meta name='licensecontent='../license.html'/>
 21       </head>
<!--

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

<!-- to top Index for DEF nodes: BoxMaterial, MyBox, PrototypeRootNode, PulsingBox, Timer, TransparencyInterpolator

Index for ProtoDeclare definition: PulsingBoxShape
-->
 22       <Scene>
 23            <Background skyColor='0.058824 0.886275 1'/>
 24            <NavigationInfo/>
 25            <ProtoDeclare name='PulsingBoxShape'>
 26                 <ProtoInterface>
 27                      <field name='boxColortype='SFColorvalue='1 0 0accessType='inputOutput'/>
 28                 </ProtoInterface>
 29                 <ProtoBody>
 30                      <!-- First node in ProtoBody determines node type of this Prototype -->
 31                      <Shape DEF='PrototypeRootNode'>
 32                           <Appearance>
 33 
                              <!-- ROUTE information for BoxMaterial node:  [from TransparencyInterpolator.value_changed to transparency ] -->
                              <Material DEF='BoxMaterialdiffuseColor='0.980392 0 0'>
 34                                     <IS>
 35                                          <connect nodeField='diffuseColorprotoField='boxColor'/>
 36                                     </IS>
 37                                </Material>
 38                           </Appearance>
 39                           <Box DEF='PulsingBoxsize='4 4 4'/>
 40                      </Shape>
 41                      <!-- ====================================================================== -->
 42                      <!-- Subsequent nodes do not render, but still must be a valid X3D subgraph -->
 43                      <!-- Note if these move into the Shape node, scene graph is no longer valid -->
 44 
                    <!-- ROUTE information for TransparencyInterpolator node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to BoxMaterial.transparency ] -->
                    <ScalarInterpolator DEF='TransparencyInterpolatorkey='0 0.5 1keyValue='1 0 1'/>
 45 
                    <!-- ROUTE information for Timer node:  [from fraction_changed to TransparencyInterpolator.set_fraction ] -->
                    <TimeSensor DEF='TimercycleInterval='10loop='true'/>
 46                      <!-- ROUTEs -->
 47                      < ROUTE  fromNode='Timer' fromField='fraction_changed' toNode='TransparencyInterpolator' toField='set_fraction'/>
 48                      < ROUTE  fromNode='TransparencyInterpolator' fromField='value_changed' toNode='BoxMaterial' toField='transparency'/>
 49                      <!-- ====================================================================== -->
 50                 </ProtoBody>
 51            </ProtoDeclare>
 52            <ProtoInstance name='PulsingBoxShapeDEF='MyBox'>
 53                 <!-- NavyBlue TODO need appinfo/documentation fields on fieldValue to match field expressivity -->
 54                 <fieldValue name='boxColorvalue='0 0 0.5'/>
 55            </ProtoInstance>
 56       </Scene>
 57  </X3D>
<!--

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

<!-- to top Index for DEF nodes: BoxMaterial, MyBox, PrototypeRootNode, PulsingBox, Timer, TransparencyInterpolator

Index for ProtoDeclare definition: PulsingBoxShape
-->
X3D Tooltips element index: Appearance, Background, Box, connect, field, fieldValue, head, IS, Material, meta, NavigationInfo, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, ScalarInterpolator, Scene, Shape, TimeSensor, 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.

Timer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
TransparencyInterpolator
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
TransparencyInterpolator
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(2)
BoxMaterial
Material
transparency
SFFloat

MyBox
ProtoInstance
PulsingBoxShape
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. 
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/X3dForWebAuthors/Chapter14Prototypes/X3dArchitectureConceptsPrototypeBodyValidationExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/X3dArchitectureConceptsPrototypeBodyValidationExample.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)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

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