X3D Model Documentation: Figure15_17WigglingSnake.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='titlecontent='Figure15_17WigglingSnake.x3d'/>
  6            <meta name='creatorcontent='Figure 15.17, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch15/15fig17.htm'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='20 August 2000'/>
 10            <meta name='modifiedcontent='20 October 2019'/>
 11            <meta name='descriptioncontent='A wiggling snake whose spine is animated using a CoordinateInterpolator node.'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter15Extrusion/Figure15_17WigglingSnake.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

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

<!-- to top Index for DEF nodes: CLOCK, SNAKE, SNAKE_WIGGLE

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
 16       <Scene>
 17            <!-- Computational cost of Extrusion compared to IndexedFaceSet: quicker to download, takes time to calculate polygonal faces and normals during initial loading, equally fast at run time. -->
 18            <!-- Authoring capabilities of Extrusion compared to IndexedFaceSet: can be more complicated to express, but also can provide great detail with much less effort. -->
 19            <!-- Animation considerations: computational cost of modifying spine and recalcuting all polygons/shading during each screen redraw is extremely high, though authorability remains very simple. -->
 20            <!-- First position and rotate viewpoint into positive-X-Y-Z octant, looking at object center -->
 21            <WorldInfo title='Figure15_17WigglingSnake.x3d'/>
 22            <Viewpoint description='Wiggling snake, seen from behind, using Extrusion and OrientationInterpolatororientation='-0.37796 0.91249 0.15656 0.85225position='10 5 10'/>
 23            <Viewpoint description='Snake headorientation='0.18581 0.96486 0.18581 -1.606566position='-10 4 0'/>
 24            <!-- Snake -->
 25            <Transform translation='0 0.3 0'>
 26                 <Shape>
 27                      <Appearance>
 28                           <Material diffuseColor='0 1.0 0.2'/>
 29                      </Appearance>
 30 
                    <!-- ROUTE information for SNAKE node:  [from SNAKE_WIGGLE.value_changed to set_spine ] -->
                    <Extrusion DEF='SNAKEcreaseAngle='1.57crossSection='1.00 0.00 0.92 -0.38 0.71 -0.71 0.38 -0.92 0.00 -1.00 -0.38 -0.92 -0.71 -0.71 -0.92 -0.38 -1.00 -0.0 -0.92 0.38 -0.71 0.71 -0.38 0.92 0.00 1.00 0.38 0.92 0.71 0.71 0.92 0.38 1.00 0.00scale='0.050 0.020 0.200 0.100 0.400 0.150 0.250 0.250 0.270 0.270 0.300 0.300 0.300 0.300 0.300 0.300 0.300 0.300 0.300 0.300 0.290 0.290 0.290 0.290 0.290 0.290 0.280 0.280 0.280 0.280 0.250 0.250 0.200 0.200 0.100 0.100 0.050 0.050spine='-4.100 0.0 0.000 -4.0 0.0 0.000 -3.529 0.0 0.674 -3.059 0.0 0.996 -2.588 0.0 0.798 -2.118 0.0 0.184 -1.647 0.0 -0.526 -1.176 0.0 -0.962 -0.706 0.0 -0.895 -0.235 0.0 -0.361 0.235 0.0 0.361 0.706 0.0 0.895 1.176 0.0 0.962 1.647 0.0 0.526 2.118 0.0 -0.184 2.588 0.0 -0.798 3.059 0.0 -0.996 3.529 0.0 -0.674 4.0 0.0 0.0'/>
 31                 </Shape>
 32            </Transform>
 33            <!-- Animation clock -->
 34 
          <!-- ROUTE information for CLOCK node:  [from fraction_changed to SNAKE_WIGGLE.set_fraction ] -->
          <TimeSensor DEF='CLOCKcycleInterval='4loop='true'/>
 35            <!-- each keyValue block corresponds to spine position at time 0.0, 0.25, 0.5, 0.75 and 1.0 (matching endpoints are closed so that looping is continuous) -->
 36            <!-- Animate the snake spine -->
 37 
          <!-- ROUTE information for SNAKE_WIGGLE node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to SNAKE.set_spine ] -->
          <CoordinateInterpolator DEF='SNAKE_WIGGLEkey='0.0 0.25 0.50 0.75 1.0keyValue='-4.100 0 0.000 -4.0 0 0.000 -3.529 0 0.674 -3.059 0 0.996 -2.588 0 0.798 -2.118 0 0.184 -1.647 0 -0.526 -1.176 0 -0.962 -0.706 0 -0.895 -0.235 0 -0.361 0.235 0 0.361 0.706 0 0.895 1.176 0 0.962 1.647 0 0.526 2.118 0 -0.184 2.588 0 -0.798 3.059 0 -0.996 3.529 0 -0.674 4.0 0 0.000 -4.100 0 -1.000 -4.0 0 -1.000 -3.529 0 -0.739 -3.059 0 -0.092 -2.588 0 0.603 -2.118 0 0.983 -1.647 0 0.850 -1.176 0 0.274 -0.706 0 -0.446 -0.235 0 -0.932 0.235 0 -0.932 0.706 0 -0.446 1.176 0 0.274 1.647 0 0.850 2.118 0 0.983 2.588 0 0.603 3.059 0 -0.092 3.529 0 -0.739 4.0 0 -1.000 -4.100 0 0.000 -4.0 0 0.000 -3.529 0 -0.674 -3.059 0 -0.996 -2.588 0 -0.798 -2.118 0 -0.184 -1.647 0 0.526 -1.176 0 0.962 -0.706 0 0.895 -0.235 0 0.361 0.235 0 -0.361 0.706 0 -0.895 1.176 0 -0.962 1.647 0 -0.526 2.118 0 0.184 2.588 0 0.798 3.059 0 0.996 3.529 0 0.674 4.0 0 0.000 -4.100 0 1.000 -4.0 0 1.000 -3.529 0 0.739 -3.059 0 0.092 -2.588 0 -0.603 -2.118 0 -0.983 -1.647 0 -0.850 -1.176 0 -0.274 -0.706 0 0.446 -0.235 0 0.932 0.235 0 0.932 0.706 0 0.446 1.176 0 -0.274 1.647 0 -0.850 2.118 0 -0.983 2.588 0 -0.603 3.059 0 0.092 3.529 0 0.739 4.0 0 1.000 -4.100 0 0.000 -4.0 0 0.000 -3.529 0 0.674 -3.059 0 0.996 -2.588 0 0.798 -2.118 0 0.184 -1.647 0 -0.526 -1.176 0 -0.962 -0.706 0 -0.895 -0.235 0 -0.361 0.235 0 0.361 0.706 0 0.895 1.176 0 0.962 1.647 0 0.526 2.118 0 -0.184 2.588 0 -0.798 3.059 0 -0.996 3.529 0 -0.674 4.0 0 0.0'/>
 38            < ROUTE  fromNode='CLOCK' fromField='fraction_changed' toNode='SNAKE_WIGGLE' toField='set_fraction'/>
 39            < ROUTE  fromNode='SNAKE_WIGGLE' fromField='value_changed' toNode='SNAKE' toField='set_spine'/>
 40       </Scene>
 41  </X3D>
<!--

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

<!-- to top Index for DEF nodes: CLOCK, SNAKE, SNAKE_WIGGLE

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
X3D Tooltips element index: Appearance, CoordinateInterpolator, Extrusion, head, Material, meta, ROUTE, Scene, Shape, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

CLOCK
TimeSensor
fraction_changed
SFFloat

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

ROUTE
event to
(2)
SNAKE
Extrusion
set_spine
MFVec3f
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/Vrml2Sourcebook/Chapter15Extrusion/Figure15_17WigglingSnakeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter15Extrusion/Figure15_17WigglingSnake.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)
-->

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