X3D Model Documentation: MotionInterpolatorFishPrototype.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='MotionInterpolatorFishPrototype.x3d'/>
  6            <meta name='descriptioncontent='Reusable prototype for a swimming CircleFish, which is also used by CircleFishLod. Default fish size: length is 1 m (Y-axis), max Height is 1 m (Z-axis), max Width is 10 cm (X-axis). Wait for it to swim onto the display!'/>
  7            <meta name='creatorcontent='Ildeniz Duman'/>
  8            <meta name='translatorcontent='Scott Tufts'/>
  9            <meta name='createdcontent='1 May 1998'/>
 10            <meta name='translatedcontent='11 December 2001'/>
 11            <meta name='modifiedcontent='17 January 2025'/>
 12            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d'/>
 13            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/MotionInterpolatorFishPrototype.x3d'/>
 14            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 15            <meta name='licensecontent='../license.html'/>
 16       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: AnimationGroup, CircleFishAngle, CirclefishPath, Eye, FinColor, FinSkin, FishBodyExtrusion, FishColor, FishTexture, FishTransform, LeftPectoral, LeftPectoralRotation, OrbitClock, RightPectoral, RightPectoralRotation, Timer, TransparencyTimer, TransparencyValue, Waggler, Way

Index for ProtoDeclare definition: CircleFish
-->
 17       <Scene>
 18            <WorldInfo title='MotionInterpolatorFishPrototype.x3d'/>
 19            <Background skyColor='0.3216 0.7333 0.7333'/>
 20            <ProtoDeclare name='CircleFish'>
 21                 <ProtoInterface>
 22                      <field name='skinTextureUrltype='MFStringaccessType='inputOutput'/>
 23                      <field name='fishScaletype='SFVec3fvalue='1 1 1accessType='inputOutput'/>
 24                      <field name='fishColortype='SFColorvalue='0.5 0.5 0.5accessType='inputOutput'/>
 25                      <field name='finColortype='SFColorvalue='0.5 0.5 0.5accessType='inputOutput'/>
 26                      <field name='positionKeytype='MFFloatvalue='0.0 0.125 0.25 0.375 0.5 0.625 0.750 0.8751accessType='inputOutput'/>
 27                      <field name='positionKeyValuetype='MFVec3fvalue='1.5 2 0 1.5 0 -1.0 0 -1 -1.0 -1.5 0 -1.0 -1.5 2 0 -1.5 0 1.0 0 -2 1.0 1.5 0 1.0 1.5 2 0accessType='inputOutput'/>
 28                      <field name='orientationKeytype='MFFloatvalue='0.0 0.25 0.5 0.750 1accessType='inputOutput'/>
 29                      <field name='orientationKeyValuetype='MFRotationvalue='0 1 0 0 0 1 0 -1.57 0 1 0 -3.14 0 1 0 -4.71 0 1 0 -6.28accessType='inputOutput'/>
 30                      <field name='orbitTimetype='SFTimevalue='90accessType='inputOutput'/>
 31                 </ProtoInterface>
 32                 <ProtoBody>
 33 
                    <!-- ROUTE information for Way node:  [from CirclefishPath.value_changed to set_translation ] [from CircleFishAngle.value_changed to set_rotation ] -->
                    <Transform DEF='Way'>
 34                           <Transform rotation='1 0 0 1.395'>
 35                                <Transform DEF='FishTransform'>
 36                                     <IS>
 37                                          <connect nodeField='scaleprotoField='fishScale'/>
 38                                     </IS>
 39                                     <Shape>
 40                                          <Appearance>
 41 
                                             <!-- ROUTE information for FishColor node:  [from TransparencyValue.value_changed to transparency ] -->
                                             <Material DEF='FishColor'>
 42                                                    <IS>
 43                                                         <connect nodeField='diffuseColorprotoField='fishColor'/>
 44                                                    </IS>
 45                                               </Material>
 46                                               <ImageTexture DEF='FishTexture'>
 47                                                    <IS>
 48                                                         <connect nodeField='urlprotoField='skinTextureUrl'/>
 49                                                    </IS>
 50                                               </ImageTexture>
 51                                          </Appearance>
 52 
                                        <!-- ROUTE information for FishBodyExtrusion node:  [from Waggler.value_changed to set_spine ] -->
                                        <Extrusion DEF='FishBodyExtrusioncreaseAngle='0.57crossSection='-0.1 1.0 0.1 1 0.5 0.5 0.5 -0.5 0.1 -1 -0.1 -1 -0.5 -0.5 -0.5 0.5 -0.1 1scale='0.03 0.03 0.05 0.3 0.05 0.45 0.1 0.5 0.05 0.45 0.05 0.2 0.03 0.4spine='0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0 0.2 0 0 0 0'/>
 53                                     </Shape>
 54 
                                   <!-- ROUTE information for TransparencyTimer node:  [from fraction_changed to TransparencyValue.set_fraction ] -->
                                   <TimeSensor DEF='TransparencyTimercycleInterval='6loop='truestartTime='1'/>
 55 
                                   <!-- ROUTE information for TransparencyValue node:  [from TransparencyTimer.fraction_changed to set_fraction ] [from value_changed to FishColor.transparency ] -->
                                   <ScalarInterpolator DEF='TransparencyValuekey='0 .5 1keyValue='0 0.8 0'/>
 56                                     < ROUTE  fromNode='TransparencyTimer' fromField='fraction_changed' toNode='TransparencyValue' toField='set_fraction'/>
 57                                     < ROUTE  fromNode='TransparencyValue' fromField='value_changed' toNode='FishColor' toField='transparency'/>
 58                                     <Shape>
 59 
                                        <!-- Appearance FinSkin is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                        <Appearance DEF='FinSkin'>
 60                                               <Material DEF='FinColortransparency='0.2'>
 61                                                    <IS>
 62                                                         <connect nodeField='diffuseColorprotoField='finColor'/>
 63                                                    </IS>
 64                                               </Material>
 65                                          </Appearance>
 66                                     </Shape>
 67                                     <Transform translation='0.015 0.8 -0.2'>
 68 
                                        <!-- Shape Eye is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                        <Shape DEF='Eye'>
 69                                               <Appearance>
 70                                                    <Material diffuseColor='0.5 0.5 0.5shininess='1specularColor='0.3 0.3 0.3'/>
 71                                               </Appearance>
 72                                               <Sphere radius='0.03'/>
 73                                          </Shape>
 74                                     </Transform>
 75                                     <Transform translation='-0.015 0.8 -0.2'>
 76                                          <Shape USE='Eye'/>
 77                                     </Transform>
 78                                     <Transform scale='1 1 0.7translation='0 0.98 0'>
 79                                          <Shape USE='Eye'/>
 80                                     </Transform>
 81 
                                   <!-- ROUTE information for LeftPectoral node:  [from LeftPectoralRotation.value_changed to set_rotation ] -->
                                   <Transform DEF='LeftPectoraltranslation='0.04 0.4 0.3'>
 82                                          <Shape>
 83                                               <Appearance USE='FinSkin'/>
 84                                               <IndexedFaceSet solid='falsecoordIndex='0 1 2 -1'>
 85                                                    <Coordinate point='0 0 0 0 0.2 0 0.2 0.1 0'/>
 86                                               </IndexedFaceSet>
 87                                          </Shape>
 88                                     </Transform>
 89 
                                   <!-- ROUTE information for RightPectoral node:  [from RightPectoralRotation.value_changed to set_rotation ] -->
                                   <Transform DEF='RightPectoraltranslation='-0.04 0.4 0.3'>
 90                                          <Shape>
 91                                               <Appearance USE='FinSkin'/>
 92                                               <IndexedFaceSet solid='falsecoordIndex='0 1 2 -1'>
 93                                                    <Coordinate point='0 0 0 0 0.2 0 -0.2 0.1 0'/>
 94                                               </IndexedFaceSet>
 95                                          </Shape>
 96                                     </Transform>
 97                                </Transform>
 98                           </Transform>
 99                           <Group DEF='AnimationGroup'>
100 
                              <!-- ROUTE information for Timer node:  [from fraction_changed to Waggler.set_fraction ] [from fraction_changed to LeftPectoralRotation.set_fraction ] [from fraction_changed to RightPectoralRotation.set_fraction ] -->
                              <TimeSensor DEF='TimercycleInterval='5loop='true'/>
101 
                              <!-- ROUTE information for Waggler node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to FishBodyExtrusion.set_spine ] -->
                              <CoordinateInterpolator DEF='Wagglerkey='0.0 0.15 0.28 0.4 0.55 0.7 0.85 1keyValue='0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0 0.2 0 0 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0.05 0.3 0 0.1 0.2 0 0.2 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0 0.2 0 0 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 -0.05 0.3 0 -0.1 0.2 0 -0.2 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0.0 0.2 0 0 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0.05 0.3 0 0.1 0.2 0 0.2 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0 0.2 0 0 0 0 0 1 0 0 0.8 0 0 0.6 0 0 0.5 0 0 0.3 0 0 0.2 0 0 0 0'/>
102                                < ROUTE  fromNode='Timer' fromField='fraction_changed' toNode='Waggler' toField='set_fraction'/>
103                                < ROUTE  fromNode='Waggler' fromField='value_changed' toNode='FishBodyExtrusion' toField='set_spine'/>
104 
                              <!-- ROUTE information for LeftPectoralRotation node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to LeftPectoral.set_rotation ] -->
                              <OrientationInterpolator DEF='LeftPectoralRotationkey='0 0.3 0.7 1keyValue='0 1 0 -.349 0 1 0 0 0 1 0 0 0 1 0 -.349'/>
105                                < ROUTE  fromNode='Timer' fromField='fraction_changed' toNode='LeftPectoralRotation' toField='set_fraction'/>
106                                < ROUTE  fromNode='LeftPectoralRotation' fromField='value_changed' toNode='LeftPectoral' toField='set_rotation'/>
107 
                              <!-- ROUTE information for RightPectoralRotation node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to RightPectoral.set_rotation ] -->
                              <OrientationInterpolator DEF='RightPectoralRotationkey='0 0.3 0.7 1keyValue='0 1 0 .349 0 1 0 0 0 1 0 0 0 1 0 .349'/>
108                                < ROUTE  fromNode='Timer' fromField='fraction_changed' toNode='RightPectoralRotation' toField='set_fraction'/>
109                                < ROUTE  fromNode='RightPectoralRotation' fromField='value_changed' toNode='RightPectoral' toField='set_rotation'/>
110 
                              <!-- ROUTE information for OrbitClock node:  [from fraction_changed to CirclefishPath.set_fraction ] [from fraction_changed to CircleFishAngle.set_fraction ] -->
                              <TimeSensor DEF='OrbitClockloop='true'>
111                                     <IS>
112                                          <connect nodeField='cycleIntervalprotoField='orbitTime'/>
113                                     </IS>
114                                </TimeSensor>
115 
                              <!-- ROUTE information for CirclefishPath node:  [from OrbitClock.fraction_changed to set_fraction ] [from value_changed to Way.set_translation ] -->
                              <PositionInterpolator DEF='CirclefishPath'>
116                                     <IS>
117                                          <connect nodeField='keyprotoField='positionKey'/>
118                                          <connect nodeField='keyValueprotoField='positionKeyValue'/>
119                                     </IS>
120                                </PositionInterpolator>
121 
                              <!-- ROUTE information for CircleFishAngle node:  [from OrbitClock.fraction_changed to set_fraction ] [from value_changed to Way.set_rotation ] -->
                              <OrientationInterpolator DEF='CircleFishAngle'>
122                                     <IS>
123                                          <connect nodeField='keyprotoField='orientationKey'/>
124                                          <connect nodeField='keyValueprotoField='orientationKeyValue'/>
125                                     </IS>
126                                </OrientationInterpolator>
127                                < ROUTE  fromNode='OrbitClock' fromField='fraction_changed' toNode='CirclefishPath' toField='set_fraction'/>
128                                < ROUTE  fromNode='OrbitClock' fromField='fraction_changed' toNode='CircleFishAngle' toField='set_fraction'/>
129                                < ROUTE  fromNode='CirclefishPath' fromField='value_changed' toNode='Way' toField='set_translation'/>
130                                < ROUTE  fromNode='CircleFishAngle' fromField='value_changed' toNode='Way' toField='set_rotation'/>
131                           </Group>
132                      </Transform>
133                 </ProtoBody>
134            </ProtoDeclare>
135            <!-- ==================== -->
136            <ProtoInstance name='CircleFish'/>
137       </Scene>
138  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: AnimationGroup, CircleFishAngle, CirclefishPath, Eye, FinColor, FinSkin, FishBodyExtrusion, FishColor, FishTexture, FishTransform, LeftPectoral, LeftPectoralRotation, OrbitClock, RightPectoral, RightPectoralRotation, Timer, TransparencyTimer, TransparencyValue, Waggler, Way

Index for ProtoDeclare definition: CircleFish
-->
X3D Tooltips element index: Appearance, Background, connect, Coordinate, CoordinateInterpolator, Extrusion, field, Group, head, ImageTexture, IndexedFaceSet, IS, Material, meta, OrientationInterpolator, PositionInterpolator, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, ScalarInterpolator, Scene, Shape, Sphere, TimeSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

OrbitClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
CirclefishPath
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
CirclefishPath
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
Way
Transform
set_translation
SFVec3f
OrbitClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
CircleFishAngle
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
CircleFishAngle
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
Way
Transform
set_rotation
SFRotation

Timer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Waggler
CoordinateInterpolator
set_fraction
SFFloat
then
 
 
 
Waggler
CoordinateInterpolator
value_changed
MFVec3f

ROUTE
event to
(2)
FishBodyExtrusion
Extrusion
set_spine
MFVec3f
Timer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
LeftPectoralRotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
LeftPectoralRotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
LeftPectoral
Transform
set_rotation
SFRotation
Timer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
RightPectoralRotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
RightPectoralRotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
RightPectoral
Transform
set_rotation
SFRotation

TransparencyTimer
TimeSensor
fraction_changed
SFFloat

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

ROUTE
event to
(2)
FishColor
Material
transparency
SFFloat

line 136
ProtoInstance
CircleFish
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/Chapter07EventAnimationInterpolation/MotionInterpolatorFishPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/MotionInterpolatorFishPrototype.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)
    <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. -->