{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.0",
    "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.0.xsd",
    "JSON schema":"http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"Figure15.17WigglingSnake.x3d"
          },
          {
            "@name":"creator",
            "@content":"Figure 15.17, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland"
          },
          {
            "@name":"reference",
            "@content":"http://www.wiley.com/legacy/compbooks/vrml2sbk/ch15/15fig17.htm"
          },
          {
            "@name":"translator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"20 August 2000"
          },
          {
            "@name":"modified",
            "@content":"14 January 2010"
          },
          {
            "@name":"description",
            "@content":"A wiggling snake whose spine is animated using a CoordinateInterpolator node."
          },
          {
            "@name":"identifier",
            "@content":"http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter15-Extrusion/Figure15.17WigglingSnake.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"19 March 2017"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"warning",
            "@content":"An experimental version of X3D JSON encoding is used for this scene.  Status online at http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          {
            "#comment":"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."
          },
          {
            "#comment":"Authoring capabilities of Extrusion compared to IndexedFaceSet: can be more complicated to express, but also can provide great detail with much less effort."
          },
          {
            "#comment":"Animation considerations: computational cost of modifying spine and recalcuting all polygons/shading during each screen redraw is extremely high, though authorability remains very simple."
          },
          {
            "#comment":"First position and rotate viewpoint into positive-X-Y-Z octant using a Transform"
          },
          { "Transform":
            {
              "@rotation":[0,1,0,0.758],
              "@translation":[10,5,10],
              "-children":[
                { "Viewpoint":
                  {
                    "@description":"Wiggling snake, seen from behind, using Extrusion and OrientationInterpolator",
                    "@orientation":[1,0,0,-0.3],
                    "@position":[0,0,0]
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@rotation":[0,1,0,-1.57],
              "@translation":[-10,4,0],
              "-children":[
                { "Viewpoint":
                  {
                    "@description":"Snake head",
                    "@orientation":[1,0,0,-0.6],
                    "@position":[0,0,0]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Snake"
          },
          { "Transform":
            {
              "@translation":[0,0.3,0],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0,1.0,0.2]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Extrusion":
                        {
                          "@DEF":"SNAKE",
                          "@creaseAngle":1.57,
                          "@crossSection":[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.00],
                          "@scale":[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.050],
                          "@spine":[-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]
                        }
                      }
                  }
                }
              ]
            }
          },
          {
            "#comment":"Animation clock"
          },
          { "TimeSensor":
            {
              "@DEF":"CLOCK",
              "@cycleInterval":4,
              "@loop":true
            }
          },
          {
            "#comment":"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)"
          },
          {
            "#comment":"Animate the snake spine"
          },
          { "CoordinateInterpolator":
            {
              "@DEF":"SNAKE_WIGGLE",
              "@key":[0.0,0.25,0.50,0.75,1.0],
              "@keyValue":[-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":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"CLOCK",
              "@toField":"set_fraction",
              "@toNode":"SNAKE_WIGGLE"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"SNAKE_WIGGLE",
              "@toField":"set_spine",
              "@toNode":"SNAKE"
            }
          }
        ]
    }
  }
}