{ "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":"Figure27.3CollisionDetectionSpinningOrb.x3d"
          },
          {
            "@name":"creator",
            "@content":"Figure 27.3, 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/ch27/27fig03.htm"
          },
          {
            "@name":"translator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"26 October 2000"
          },
          {
            "@name":"modified",
            "@content":"11 January 2014"
          },
          {
            "@name":"description",
            "@content":"An orb that animates (for a single revolution) when the viewer collides with its box proxy shape. Walk towards the orb by using the up-arrow key."
          },
          {
            "@name":"identifier",
            "@content":"http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/Figure27.3CollisionDetectionSpinningOrb.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":[
          { "Viewpoint":
            {
              "@description":"Zoom in on the orb to trigger the Collision node",
              "@position":[0,2,10]
            }
          },
          { "Viewpoint":
            {
              "@description":"Close-up viewpoint by the orb that triggers the Collision node",
              "@position":[0,0.8,2.5]
            }
          },
          {
            "#comment":"Note NavigationInfo avatarSize affects collision range"
          },
          { "NavigationInfo":
            {
              "@avatarSize":[2,1,0.5],
              "@headlight":false,
              "@speed":2,
              "@type":["WALK","EXAMINE","ANY"]
            }
          },
          { "Group":
            {
              "-children":[
                { "Transform":
                  {
                    "@translation":[0,0,2.5],
                    "-children":[
                      { "Inline":
                        {
                          "@DEF":"Floor",
                          "@url":["../Chapter25-LevelOfDetail/Figure25.06DungeonRoomFloor.x3d","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.06DungeonRoomFloor.x3d","../Chapter25-LevelOfDetail/Figure25.06DungeonRoomFloor.wrl","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.06DungeonRoomFloor.wrl"]
                        }
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[0,0,-2.5],
                    "-children":[
                      { "Inline":
                        {
                          "@USE":"Floor"
                        }
                      }
                    ]
                  }
                },
                { "Collision":
                  {
                    "@DEF":"OrbCollide",
                    "-children":[
                      {
                        "#comment":"Note that proxy geometry is not rendered"
                      },
                      {
                        "#comment":"If you want to also see the simplifying proxy geometry, DEF/USE it outside of the proxy containerField subtree."
                      },
                      { "Transform":
                        {
                          "@USE":"ProxyGeometryTransform"
                        }
                      },
                      {
                        "#comment":"Rest of collidable scene follows."
                      },
                      { "Transform":
                        {
                          "@DEF":"OrbSpin",
                          "@translation":[0,1,0],
                          "-children":[
                            { "PointLight":
                              {
                                "@ambientIntensity":0.2,
                                "@color":[0.7,0.5,0],
                                "@location":[0.3,0,0],
                                "@radius":10
                              }
                            },
                            { "Shape":
                              {
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-texture":
                                        { "ImageTexture":
                                          {
                                            "@url":["fire.jpg","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/fire.jpg"]
                                          }
                                        },
                                      "-children":[
                                        {
                                          "#comment":"alternate emissive material as backup, comparable to fire.jpg texturing"
                                        }
                                      ],
                                      "-material":
                                        { "Material":
                                          {
                                            "@emissiveColor":[0.8,0.4,0.1]
                                          }
                                        }
                                    }
                                  },
                                "-geometry":
                                  { "Sphere":
                                    {
                                      "@radius":0.2
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                    ],
                    "-proxy":
                      { "Transform":
                        {
                          "@DEF":"ProxyGeometryTransform",
                          "@translation":[0,0.6,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[0.4,1.2,0.4]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@transparency":0.8
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"PedestalColor",
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.7,0.6,0.5]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "IndexedFaceSet":
                        {
                          "@coordIndex":[0,1,4,-1,1,2,4,-1,2,3,4,-1,3,0,4,-1],
                          "-coord":
                            { "Coordinate":
                              {
                                "@point":[-0.12,0.03,0.12,0.12,0.03,0.12,0.12,0.03,-0.12,-0.12,0.03,-0.12,0.0,0.63,0.0]
                              }
                            }
                        }
                      }
                  }
                },
                { "Transform":
                  {
                    "@translation":[0,0.015,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "@USE":"PedestalColor"
                              }
                            },
                          "-geometry":
                            { "Box":
                              {
                                "@size":[0.4,0.03,0.4]
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Sound":
            {
              "@DEF":"WispyAmp",
              "@intensity":0.5,
              "-source":
                { "AudioClip":
                  {
                    "@DEF":"Wispy",
                    "@description":"drone",
                    "@loop":true,
                    "@url":["drone1.wav","http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/drone1.wav"]
                  }
                }
            }
          },
          {
            "#comment":"Animation clock"
          },
          { "TimeSensor":
            {
              "@DEF":"Clock",
              "@cycleInterval":8
            }
          },
          { "ROUTE":
            {
              "@fromField":"collideTime",
              "@fromNode":"OrbCollide",
              "@toField":"set_startTime",
              "@toNode":"Clock"
            }
          },
          { "ROUTE":
            {
              "@fromField":"collideTime",
              "@fromNode":"OrbCollide",
              "@toField":"set_startTime",
              "@toNode":"Wispy"
            }
          },
          {
            "#comment":"Orb rotation animation and scalar-driven volume control"
          },
          { "OrientationInterpolator":
            {
              "@DEF":"OrbSpinner",
              "@key":[0,0.5,1],
              "@keyValue":[0,1,0,0.0,0,1,0,3.14,0,1,0,6.28]
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"Clock",
              "@toField":"set_fraction",
              "@toNode":"OrbSpinner"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"OrbSpinner",
              "@toField":"set_rotation",
              "@toNode":"OrbSpin"
            }
          },
          { "ScalarInterpolator":
            {
              "@DEF":"WispyVolume",
              "@key":[0,0.1,0.9,1],
              "@keyValue":[0,0.6,0.6,0]
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"Clock",
              "@toField":"set_fraction",
              "@toNode":"WispyVolume"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"WispyVolume",
              "@toField":"set_intensity",
              "@toNode":"WispyAmp"
            }
          }
        ]
    }
  }
}