{ "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":"Figure31.7DonutExternalPrototype.x3d"
          },
          {
            "@name":"creator",
            "@content":"Figure 31.7, 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/ch31/31fig07.htm"
          },
          {
            "@name":"translator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"22 November 2000"
          },
          {
            "@name":"modified",
            "@content":"25 March 2012"
          },
          {
            "@name":"description",
            "@content":"A donut shape built using the Donut geometry node and the LightOak appearance node. Also see Figures 30.5 and 31.6 for comparison."
          },
          {
            "@name":"identifier",
            "@content":"http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.7DonutExternalPrototype.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":[
          { "ExternProtoDeclare":
            {
              "@name":"Donut",
              "@url":["Figure31.6DonutPrototype.wrl#Donut","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.6DonutPrototype.wrl#Donut","Figure31.6DonutPrototype.x3d#Donut","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.6DonutPrototype.x3d#Donut"],
              "field": [
                {
                  "@name":"crossSectionRadius",
                  "@accessType":"initializeOnly",
                  "@type":"SFFloat"
                },
                {
                  "@name":"spineRadius",
                  "@accessType":"initializeOnly",
                  "@type":"SFFloat"
                },
                {
                  "@name":"crossSectionResolution",
                  "@accessType":"initializeOnly",
                  "@type":"SFInt32"
                },
                {
                  "@name":"spineResolution",
                  "@accessType":"initializeOnly",
                  "@type":"SFInt32"
                },
                {
                  "@name":"set_crossSectionRadius",
                  "@accessType":"inputOnly",
                  "@type":"SFFloat"
                },
                {
                  "@name":"set_spineRadius",
                  "@accessType":"inputOnly",
                  "@type":"SFFloat"
                }
              ]
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"LightOak",
              "@url":["Figure31.4WoodAppearancePrototypesLibrary.wrl#LightOak","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.wrl#LightOak","Figure31.4WoodAppearancePrototypesLibrary.x3d#LightOak","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.x3d#LightOak"],
              "field": [
                {
                  "@name":"textureTransform",
                  "@accessType":"inputOutput",
                  "@type":"SFNode"
                }
              ]
            }
          },
          { "Viewpoint":
            {
              "@description":"Click to pick a size",
              "@orientation":[1,0,0,-0.52],
              "@position":[0,7,12]
            }
          },
          {
            "#comment":"Donut instances from prototypes"
          },
          { "Transform":
            {
              "@translation":[0,2,0],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "ProtoInstance":
                        {
                          "@name":"Donut",
                          "fieldValue": [
                            {
                              "@name":"crossSectionRadius",
                              "@value":1
                            },
                            {
                              "@name":"spineRadius",
                              "@value":2
                            }
                          ]
                        }
                      },
                    "-appearance":
                      { "ProtoInstance":
                        {
                          "@name":"LightOak",
                          "fieldValue": [
                            {
                              "@name":"textureTransform",
                              "-children":[
                                { "TextureTransform":
                                  {
                                    "@center":[-0,5],
                                    "@rotation":0.758,
                                    "@scale":[2,0.5],
                                    "@translation":[0.5,0]
                                  }
                                }
                              ]
                            }
                          ]
                        }
                      }
                  }
                }
              ]
            }
          },
          {
            "#comment":"Hmmm, what size donut do you really want?"
          },
          { "TimeSensor":
            {
              "@DEF":"Clock",
              "@cycleInterval":10,
              "@loop":true
            }
          },
          { "ScalarInterpolator":
            {
              "@DEF":"DonutThickness",
              "@key":[0,0.4,0.5,0.9,1],
              "@keyValue":[0.75,1.25,1.25,0.75,0.75]
            }
          },
          { "Transform":
            {
              "@translation":[0,-2,0],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "ProtoInstance":
                        {
                          "@name":"Donut",
                          "@DEF":"SpecialtyOfTheHouse",
                          "fieldValue": [
                            {
                              "@name":"crossSectionRadius",
                              "@value":0.5
                            },
                            {
                              "@name":"spineRadius",
                              "@value":2
                            }
                          ]
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-texture":
                            { "ImageTexture":
                              {
                                "@url":["../Chapter17-Textures/icing.jpg","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter17-Textures/icing.jpg"]
                              }
                            }
                        }
                      }
                  }
                },
                { "TouchSensor":
                  {
                    "@DEF":"StopSizeChanges",
                    "@description":"touch to stop size changes"
                  }
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"Clock",
              "@toField":"set_fraction",
              "@toNode":"DonutThickness"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"DonutThickness",
              "@toField":"set_crossSectionRadius",
              "@toNode":"SpecialtyOfTheHouse"
            }
          },
          { "ROUTE":
            {
              "@fromField":"touchTime",
              "@fromNode":"StopSizeChanges",
              "@toField":"stopTime",
              "@toNode":"Clock"
            }
          }
        ]
    }
  }
}