<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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'>
  <head>
    <meta content='StairStepPrototype.x3d' name='title'/>
    <meta content='Build one or more stair steps, in a straight line' name='description'/>
    <meta content='Don Brutzman, Michele Foti, Chad Hutchins' name='creator'/>
    <meta content='25 January 2012' name='created'/>
    <meta content='20 October 2019' name='modified'/>
    <meta content='under development' name='warning'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='StairStepPrototype.x3d'/>
    <Viewpoint description='hey step' orientation='-0.59028 0.76927 0.2445 0.98786' position='2 2 2'/>
    <Background skyColor='1 1 1'/>
    <ProtoDeclare appinfo='Generate multiple stair steps, bottom left-hand corner at origin, going up along X axis' name='StairSteps'>
      <ProtoInterface>
        <field accessType='inputOutput' appinfo='default value 0.8 0.8 0.6' name='diffuseColor' type='SFColor' value='0.8 0.8 0.6'/>
        <field accessType='inputOutput' appinfo='size of step, default' name='scale' type='SFVec3f' value='1 0.2 0.3'/>
        <field accessType='inputOutput' appinfo='TODO' name='numberOfSteps' type='SFInt32' value='1'/>
        <field accessType='inputOutput' appinfo='debug trace to Browser output console' name='traceEnabled' type='SFBool' value='true'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- First node determines node type of this prototype -->
        <Transform DEF='TransformXdepthYheightZwidth'>
          <IS>
            <connect nodeField='scale' protoField='scale'/>
          </IS>
          <Shape DEF='SingleStepShape'>
            <IndexedFaceSet DEF='StepIFS' coordIndex='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' solid='false'>
              <Coordinate DEF='StepCoordinate' point='0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 0 1 1'/>
            </IndexedFaceSet>
            <Appearance>
              <Material>
                <IS>
                  <connect nodeField='diffuseColor' protoField='diffuseColor'/>
                </IS>
              </Material>
              <!-- TODO expose ImageTexture -->
            </Appearance>
          </Shape>
        </Transform>
        <!-- Subsequent nodes do not render, but still must be a valid X3D subgraph -->
        <!-- This Script provides the X3D author with additional visibility and control over prototype inputs and outputs -->
        <Script DEF='StairStepPrototypeScript' directOutput='true' url='"StairStepPrototypeScript.js" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototypeScript.js"'>
          <field accessType='inputOutput' appinfo='default value 0.8 0.8 0.6' name='diffuseColor' type='SFColor'/>
          <field accessType='inputOutput' appinfo='size of step' name='scale' type='SFVec3f'/>
          <field accessType='inputOutput' appinfo='TODO' name='numberOfSteps' type='SFInt32'/>
          <field accessType='inputOutput' appinfo='debug trace to Browser output console' name='traceEnabled' type='SFBool'/>
          <field accessType='outputOnly' name='computedPoints' type='MFVec3f'/>
          <field accessType='outputOnly' name='computedCoordIndex' type='MFInt32'/>
          <IS>
            <connect nodeField='diffuseColor' protoField='diffuseColor'/>
            <connect nodeField='scale' protoField='scale'/>
            <connect nodeField='numberOfSteps' protoField='numberOfSteps'/>
            <connect nodeField='traceEnabled' protoField='traceEnabled'/>
          </IS>
        </Script>
        <ROUTE fromField='computedCoordIndex' fromNode='StairStepPrototypeScript' toField='set_coordIndex' toNode='StepIFS'/>
        <ROUTE fromField='computedPoints' fromNode='StairStepPrototypeScript' toField='point' toNode='StepCoordinate'/>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoInstance DEF='stairs' name='StairSteps'>
      <fieldValue name='diffuseColor' value='0.0 0.3 0.6'/>
      <fieldValue name='numberOfSteps' value='7'/>
      <fieldValue name='scale' value='1.0 0.2 0.3'/>
    </ProtoInstance>
    <Inline DEF='CoordinateAxes' url='"../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "../../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl"'/>
  </Scene>
</X3D>