X3D Model Documentation: SliderExample.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0'  xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='title' content='SliderExample.x3d'/>
  6            <meta name='creator' content='Mike Hunsberger'/>
  7            <meta name='created' content='12 February 2001'/>
  8            <meta name='modified' content='28 November 2019'/>
  9            <meta name='description' content='This example uses an external proto SliderProto to generate a slider that produces integer values.'/>
 10            <meta name=' warning ' content=' needs troubleshooting. '/>
 11            <meta name='identifier' content='https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderExample.x3d'/>
 12            <meta name='generator' content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
 13            <meta name='license' content='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: Converter, Scaler, Slider, VALUE_TEXT

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definitions: ScaledSFFloat, SingleTypeConversion, Slider
-->
 15       <Scene>
 16            <WorldInfo title='SliderExample.x3d'/>
 17            <ExternProtoDeclare name='Slider'   url=' "SliderPrototype.x3d#Slider" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.x3d#Slider" "SliderPrototype.wrl#Slider" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.wrl#Slider" '>
 18                 <field name='height' type='SFFloat' accessType='initializeOnly'/>
 19                 <field name='radius' type='SFFloat' accessType='initializeOnly'/>
 20                 <field name='min' type='SFInt32' accessType='initializeOnly'/>
 21                 <field name='max' type='SFInt32' accessType='initializeOnly'/>
 22                 <field name='value' type='SFInt32' accessType='initializeOnly'/>
 23                 <field name='set_min' type='SFInt32' accessType='inputOnly'/>
 24                 <field name='set_max' type='SFInt32' accessType='inputOnly'/>
 25                 <field name='set_value' type='SFInt32' accessType='outputOnly'/>
 26                 <field name='value_changed' type='SFInt32' accessType='outputOnly'/>
 27            </ExternProtoDeclare>
 28            <ExternProtoDeclare name='ScaledSFFloat'   url=' "SliderPrototype.x3d#ScaledSFFloat" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.x3d#ScaledSFFloat" "SliderPrototype.wrl#ScaledSFFloat" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.wrl#ScaledSFFloat" '>
 29                 <field name='oldMin' type='SFFloat' accessType='initializeOnly'/>
 30                 <field name='oldMax' type='SFFloat' accessType='initializeOnly'/>
 31                 <field name='newMin' type='SFFloat' accessType='initializeOnly'/>
 32                 <field name='newMax' type='SFFloat' accessType='initializeOnly'/>
 33                 <field name='set_oldMin' type='SFFloat' accessType='inputOnly'/>
 34                 <field name='set_oldMax' type='SFFloat' accessType='inputOnly'/>
 35                 <field name='set_newMin' type='SFFloat' accessType='inputOnly'/>
 36                 <field name='set_newMax' type='SFFloat' accessType='inputOnly'/>
 37                 <field name='set_value' type='SFFloat' accessType='inputOnly'/>
 38                 <field name='value_changed' type='SFFloat' accessType='outputOnly'/>
 39            </ExternProtoDeclare>
 40            <ExternProtoDeclare name='SingleTypeConversion'   url=' "SliderPrototype.x3d#SingleTypeConversion" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.x3d#SingleTypeConversion" "SliderPrototype.wrl#SingleTypeConversion" "https://savage.nps.edu/Savage/Tools/ExerciseClock/SliderPrototype.wrl#SingleTypeConversion" '>
 41                 <field name='SFBoolValue' type='SFBool' accessType='inputOnly'/>
 42                 <field name='SFFloatValue' type='SFFloat' accessType='inputOnly'/>
 43                 <field name='SFInt32Value' type='SFInt32' accessType='inputOnly'/>
 44                 <field name='SFStringValue' type='SFString' accessType='inputOnly'/>
 45                 <field name='SFBoolResult' type='SFBool' accessType='outputOnly'/>
 46                 <field name='SFFloatResult' type='SFFloat' accessType='outputOnly'/>
 47                 <field name='SFInt32Result' type='SFInt32' accessType='outputOnly'/>
 48                 <field name='SFStringResult' type='SFString' accessType='outputOnly'/>
 49                 <field name='MFStringResult' type='MFString' accessType='outputOnly'/>
 50            </ExternProtoDeclare>
 51            <Viewpoint description='Slider Example'/>
 52            <Transform rotation='0 0 1 -1.57079'>
 53 
               <!-- ROUTE information for Slider node:  [from value_changed to Converter.SFInt32Value ] -->
               <ProtoInstance name='Slider' DEF='Slider'>
 54                      <fieldValue name='min' value='0'/>
 55                      <fieldValue name='max' value='24'/>
 56                      <fieldValue name='height' value='5'/>
 57                      <fieldValue name='radius' value='0.1'/>
 58                      <fieldValue name='value' value='12'/>
 59                 </ProtoInstance>
 60            </Transform>
 61            <Transform translation='4 2 0'>
 62                 <Shape>
 63 
                    <!-- ROUTE information for VALUE_TEXT node:  [from Converter.MFStringResult to set_string ] -->
                    <Text DEF='VALUE_TEXT' string='"Value"'/>
 64                 </Shape>
 65            </Transform>
 66 
          <!-- ROUTE information for Converter node:  [from Slider.value_changed to SFInt32Value ] [from SFFloatResult to Scaler.set_value ] [from MFStringResult to VALUE_TEXT.set_string ] -->
          <ProtoInstance name='SingleTypeConversion' DEF='Converter'/>
 67 
          <!-- ROUTE information for Scaler node:  [from Converter.SFFloatResult to set_value ] -->
          <ProtoInstance name='ScaledSFFloat' DEF='Scaler'>
 68                 <fieldValue name='oldMin' value='0'/>
 69                 <fieldValue name='oldMax' value='24'/>
 70                 <fieldValue name='newMin' value='0'/>
 71                 <fieldValue name='newMax' value='1'/>
 72            </ProtoInstance>
 73            < ROUTE  fromNode='Slider' fromField='value_changed' toNode='Converter' toField='SFInt32Value'/>
 74            < ROUTE  fromNode='Converter' fromField='SFFloatResult' toNode='Scaler' toField='set_value'/>
 75            < ROUTE  fromNode='Converter' fromField='MFStringResult' toNode='VALUE_TEXT' toField='set_string'/>
 76       </Scene>
 77  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: Converter, Scaler, Slider, VALUE_TEXT

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definitions: ScaledSFFloat, SingleTypeConversion, Slider
-->
X3D Tooltips element index: ExternProtoDeclare, field, fieldValue, head, meta, ProtoInstance, ROUTE, Scene, Shape, Text, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

      Converter
ProtoInstance
SFFloatResult
SFFloat
→
ROUTE
event to
(1)
Scaler
ProtoInstance
set_value
SFFloat
Converter
ProtoInstance
MFStringResult
MFString
→
ROUTE
event to
(1)
VALUE_TEXT
Text
set_string
MFString

      Scaler
ProtoInstance
ScaledSFFloat
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. 

Slider
ProtoInstance
value_changed
SFInt32
→
ROUTE
event to
(1)
Converter
ProtoInstance
SFInt32Value
SFInt32
then
 
 
 
Converter
ProtoInstance
MFStringResult
MFString
→
ROUTE
event to
(2)
VALUE_TEXT
Text
set_string
MFString
  then
 
 
 
Converter
ProtoInstance
SFFloatResult
SFFloat
→
ROUTE
event to
(2)
Scaler
ProtoInstance
set_value
SFFloat

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://savage.nps.edu/Savage/Tools/ExerciseClock/SliderExampleIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/Tools/ExerciseClock/SliderExample.x3d -->

<!-- Color-coding 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. -->