X3D Model Documentation: StairStepPrototype.x3d

  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            <meta name='titlecontent='StairStepPrototype.x3d'/>
  6            <meta name='descriptioncontent='Build one or more stair steps, in a straight line'/>
  7            <meta name='creatorcontent='Don Brutzman, Michele Foti, Chad Hutchins'/>
  8            <meta name='createdcontent='25 January 2012'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name=' warning content=' under development '/>
 11            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototype.x3d'/>
 12            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 13            <meta name='licensecontent='../license.html'/>
 14       </head>
<!--

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

<!-- to top Index for DEF nodes: CoordinateAxes, SingleStepShape, stairs, StairStepPrototypeScript, StepCoordinate, StepIFS, TransformXdepthYheightZwidth

Index for Viewpoint node: Viewpoint_1

Index for ProtoDeclare definition: StairSteps
-->
 15       <Scene>
 16            <WorldInfo title='StairStepPrototype.x3d'/>
 17            <Viewpoint description='hey steporientation='-0.59028 0.76927 0.2445 0.98786position='2 2 2'/>
 18            <Background skyColor='1 1 1'/>
 19            <ProtoDeclare name='StairStepsappinfo='Generate multiple stair steps, bottom left-hand corner at origin, going up along X axis'>
 20                 <ProtoInterface>
 21                      <field name='diffuseColortype='SFColorvalue='0.8 0.8 0.6accessType='inputOutput'
                     appinfo='default value 0.8 0.8 0.6'/>
 22                      <field name='scaletype='SFVec3fvalue='1 0.2 0.3accessType='inputOutput'
                     appinfo='size of step, default'/>
 23                      <field name='numberOfStepstype='SFInt32value='1accessType='inputOutput'
                     appinfo='TODO'/>
 24                      <field name='traceEnabledtype='SFBoolvalue='trueaccessType='inputOutput'
                     appinfo='debug trace to Browser output console'/>
 25                 </ProtoInterface>
 26                 <ProtoBody>
 27                      <!-- First node determines node type of this prototype -->
 28                      <Transform DEF='TransformXdepthYheightZwidth'>
 29                           <IS>
 30                                <connect nodeField='scaleprotoField='scale'/>
 31                           </IS>
 32                           <Shape DEF='SingleStepShape'>
 33 
                              <!-- ROUTE information for StepIFS node:  [from StairStepPrototypeScript.computedCoordIndex to set_coordIndex ] -->
                              <IndexedFaceSet DEF='StepIFSsolid='falsecoordIndex='0 1 2 3 -1 4 5 6 7 -1 0 1 5 4 -1 1 2 6 5 -1 0 3 7 4 -1 3 2 6 7 -1'>
 34 
                                   <!-- ROUTE information for StepCoordinate node:  [from StairStepPrototypeScript.computedPoints to point ] -->
                                   <Coordinate DEF='StepCoordinatepoint='0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 0 1 1'/>
 35                                </IndexedFaceSet>
 36                                <Appearance>
 37                                     <Material>
 38                                          <IS>
 39                                               <connect nodeField='diffuseColorprotoField='diffuseColor'/>
 40                                          </IS>
 41                                     </Material>
 42                                     <!-- TODO expose ImageTexture -->
 43                                </Appearance>
 44                           </Shape>
 45                      </Transform>
 46                      <!-- Subsequent nodes do not render, but still must be a valid X3D subgraph -->
 47                      <!-- This Script provides the X3D author with additional visibility and control over prototype inputs and outputs -->
 48 
                    <!-- ROUTE information for StairStepPrototypeScript node:  [from computedCoordIndex to StepIFS.set_coordIndex ] [from computedPoints to StepCoordinate.point ] -->
                    <Script DEF='StairStepPrototypeScriptdirectOutput='true'   url=' "StairStepPrototypeScript.js" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototypeScript.js" '>
 49                           <field name='diffuseColortype='SFColoraccessType='inputOutput'
                          appinfo='default value 0.8 0.8 0.6'/>
 50                           <field name='scaletype='SFVec3faccessType='inputOutput'
                          appinfo='size of step'/>
 51                           <field name='numberOfStepstype='SFInt32accessType='inputOutput'
                          appinfo='TODO'/>
 52                           <field name='traceEnabledtype='SFBoolaccessType='inputOutput'
                          appinfo='debug trace to Browser output console'/>
 53                           <field name='computedPointstype='MFVec3faccessType='outputOnly'/>
 54                           <field name='computedCoordIndextype='MFInt32accessType='outputOnly'/>
 55                           <IS>
 56                                <connect nodeField='diffuseColorprotoField='diffuseColor'/>
 57                                <connect nodeField='scaleprotoField='scale'/>
 58                                <connect nodeField='numberOfStepsprotoField='numberOfSteps'/>
 59                                <connect nodeField='traceEnabledprotoField='traceEnabled'/>
 60                           </IS>
 61                      </Script>
 62                      < ROUTE  fromNode='StairStepPrototypeScript' fromField='computedCoordIndex' toNode='StepIFS' toField='set_coordIndex'/>
 63                      < ROUTE  fromNode='StairStepPrototypeScript' fromField='computedPoints' toNode='StepCoordinate' toField='point'/>
 64                 </ProtoBody>
 65            </ProtoDeclare>
 66            <ProtoInstance name='StairStepsDEF='stairs'>
 67                 <fieldValue name='diffuseColorvalue='0.0 0.3 0.6'/>
 68                 <fieldValue name='numberOfStepsvalue='7'/>
 69                 <fieldValue name='scalevalue='1.0 0.2 0.3'/>
 70            </ProtoInstance>
 71            <Inline DEF='CoordinateAxes'   url=' "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "../../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" '/>
 72       </Scene>
 73  </X3D>
<!--

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

<!-- to top Index for DEF nodes: CoordinateAxes, SingleStepShape, stairs, StairStepPrototypeScript, StepCoordinate, StepIFS, TransformXdepthYheightZwidth

Index for Viewpoint node: Viewpoint_1

Index for ProtoDeclare definition: StairSteps
-->
X3D Tooltips element index: Appearance, Background, connect, Coordinate, field, fieldValue, head, IndexedFaceSet, Inline, IS, Material, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Script, Shape, Transform, Viewpoint, 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.

StairStepPrototypeScript
Script
computedCoordIndex
MFInt32

ROUTE
event to
(1)
StepIFS
IndexedFaceSet
set_coordIndex
MFInt32
StairStepPrototypeScript
Script
computedPoints
MFVec3f

ROUTE
event to
(1)
StepCoordinate
Coordinate
point
MFVec3f

stairs
ProtoInstance
StairSteps
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/X3dForAdvancedModeling/GeometricShapes/StairStepPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototype.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. -->