<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<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 '>
<head>
<meta name='titlecontent='Figure15_17WigglingSnakeWithAxes.x3d'/>
<meta name='creatorcontent='Figure 15.17, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='referencecontent=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch15/15fig17.htm '/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='20 August 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='A wiggling snake whose spine is animated using a CoordinateInterpolator node.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter15Extrusion/Figure15_17WigglingSnakeWithAxes.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for DEF nodes : CLOCK, CoordinateAxes, SNAKE, SNAKE_WIGGLE

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->
<Scene>
<!-- 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. -->
<!-- Authoring capabilities of Extrusion compared to IndexedFaceSet: can be more complicated to express, but also can provide great detail with much less effort. -->
<!-- Animation considerations: computational cost of modifying spine and recalcuting all polygons/shading during each screen redraw is extremely high, though authorability remains very simple. -->
<!-- First position and rotate viewpoint into positive-X-Y-Z octant, looking at object center -->
<WorldInfo title='Figure15_17WigglingSnakeWithAxes.x3d'/>
<Viewpoint description='Wiggling snake, seen from behind, using Extrusion and OrientationInterpolatororientation='-0.37796 0.91249 0.15656 0.85225position='10 5 10'/>
<Viewpoint description='Snake headorientation='0.18581 0.96486 0.18581 -1.606566position='-10 4 0'/>
<!-- Floor plane -->
<Shape>
<Appearance>
<Material diffuseColor='0.6 0.6 0'/>
</Appearance>
<Box size='20 0.01 20'/>
</Shape>
<!-- Snake -->
<Transform translation='0 0.3 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 1.0 0.2'/>
</Appearance>
<!-- 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'/>
</Shape>
</Transform>
<!-- Adding this Inline reference to another scene superimposes X3D/VRML coordinate system axes. -->
<Transform scale='5 5 5'> </Transform>
<!-- Animation clock -->
<!-- ROUTE information for CLOCK node:  [from fraction_changed to SNAKE_WIGGLE.set_fraction ] -->
<TimeSensor DEF='CLOCKcycleInterval='4loop='true'/>
<!-- 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) -->
<!-- Animate the snake spine -->
<!-- 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'/>
<ROUTE fromNode='CLOCKfromField='fraction_changedtoNode='SNAKE_WIGGLEtoField='set_fraction'/>
<ROUTE fromNode='SNAKE_WIGGLEfromField='value_changedtoNode='SNAKEtoField='set_spine'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : CLOCK, CoordinateAxes, SNAKE, SNAKE_WIGGLE

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

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