{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Interactive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"Switch.x3d"
          },
          {
            "@name":"description",
            "@content":"Example for Switch node"
          },
          {
            "@name":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"13 November 2005"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"rights",
            "@content":"Copyright (c) 2005, Daly Realism and Don Brutzman"
          },
          {
            "@name":"subject",
            "@content":"X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/Switch.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"25 March 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"Switch.x3d"
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "Viewpoint":
            {
              "@description":"Switch among multiple children",
              "@orientation":[-0.668,-0.724,-0.174,0.7],
              "@position":[-1.93,1.78,3.28]
            }
          },
          {
            "#comment":"Authors can manually change whichChoice values (from 0 through 3) to show each child shape"
          },
          { "Switch":
            {
              "@DEF":"Switcher",
              "@whichChoice":0,
              "-children":[
                { "Shape":
                  {
                    "@DEF":"BoxShape",
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[1,0,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Box":
                        {
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "@DEF":"ConeShape",
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[1,1,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Cone":
                        {
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "@DEF":"CylinderShape",
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0,1,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Cylinder":
                        {
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "@DEF":"SphereShape",
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0,0,1]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Sphere":
                        {
                        }
                      }
                  }
                }
              ]
            }
          },
          { "Group":
            {
              "@DEF":"AnimationGroup",
              "-children":[
                {
                  "#comment":"Total cycleInterval=\"8\" gives 2 seconds to each of the 4 colors"
                },
                {
                  "#comment":"Authors can set enabled='true' loop='true' for a continuous animation"
                },
                { "TimeSensor":
                  {
                    "@DEF":"Timer",
                    "@cycleInterval":8,
                    "@enabled":false,
                    "@loop":true
                  }
                },
                { "IntegerSequencer":
                  {
                    "@DEF":"Counter",
                    "@key":[0,0.25,0.5,0.75,1],
                    "@keyValue":[0,1,2,3,0]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"fraction_changed",
                    "@fromNode":"Timer",
                    "@toField":"set_fraction",
                    "@toNode":"Counter"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"Counter",
                    "@toField":"whichChoice",
                    "@toNode":"Switcher"
                  }
                }
              ]
            }
          }
        ]
    }
  }
}