{ "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":"Figure09.7CylinderSensorWithAxes.x3d"
          },
          {
            "@name":"creator",
            "@content":"Figure 9.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/ch09/09fig07.htm"
          },
          {
            "@name":"transcriber",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"12 August 2000"
          },
          {
            "@name":"modified",
            "@content":"9 March 2014"
          },
          {
            "@name":"description",
            "@content":"Two shapes that rotate about an axis when the viewer drags them, with coordinate axes superimposed to show X3D/VRML directions."
          },
          {
            "@name":"identifier",
            "@content":"http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09-SensingViewer/Figure09.7CylinderSensorWithAxes.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":"Click and drag to rotate shapes. Superfluous Group nodes removed."
          },
          {
            "#comment":"First rotate to reorient the first CylinderSensor"
          },
          { "Transform":
            {
              "@rotation":[1,0,0,1.57],
              "@translation":[-2,0,0],
              "-children":[
                { "CylinderSensor":
                  {
                    "@DEF":"FIRST_CYLINDERSENSOR",
                    "@description":"Click and drag to rotate",
                    "@maxAngle":1.57,
                    "@minAngle":-0.78
                  }
                },
                { "Transform":
                  {
                    "@DEF":"FIRST_TRANSFORM",
                    "-children":[
                      {
                        "#comment":"Note that we are connecting a rotation output to a rotation input in these ROUTEs."
                      },
                      { "ROUTE":
                        {
                          "@fromField":"rotation_changed",
                          "@fromNode":"FIRST_CYLINDERSENSOR",
                          "@toField":"set_rotation",
                          "@toNode":"FIRST_TRANSFORM"
                        }
                      },
                      {
                        "#comment":"Keep transparent user-interface geometry in this rotated CylinderSensor coordinate frame"
                      },
                      { "Transform":
                        {
                          "@DEF":"TRANSPARENT_CYLINDER_TRANSFORM",
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Cylinder":
                                    {
                                      "@height":0.5
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@diffuseColor":[0.7,0.7,0.7],
                                            "@transparency":0.5
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      {
                        "#comment":"Now restore original Y=up coordinate frame prior to drawing actual geometry"
                      },
                      { "Transform":
                        {
                          "@rotation":[1,0,0,-1.57],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[1,3,1]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@DEF":"FIRST_APPEARANCE",
                                      "-material":
                                        { "Material":
                                          {
                                            "@diffuseColor":[0.9,0.9,0.1],
                                            "@emissiveColor":[0.2,0.2,0.05]
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Note this second example uses a simpler pattern: since we are not rotating the axis of the CylinderSensor away from the vertical, we do not need to change that rotation back again for the target geometry."
          },
          { "Transform":
            {
              "@DEF":"SECOND_TRANSFORM",
              "@translation":[2,0,0],
              "-children":[
                { "CylinderSensor":
                  {
                    "@DEF":"SECOND_CYLINDERSENSOR",
                    "@description":"Click and drag to rotate"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"rotation_changed",
                    "@fromNode":"SECOND_CYLINDERSENSOR",
                    "@toField":"set_rotation",
                    "@toNode":"SECOND_TRANSFORM"
                  }
                },
                {
                  "#comment":"Keep transparent user-interface geometry in this rotated CylinderSensor coordinate frame"
                },
                { "Transform":
                  {
                    "@USE":"TRANSPARENT_CYLINDER_TRANSFORM"
                  }
                },
                {
                  "#comment":"Rotate actual geometry"
                },
                { "Transform":
                  {
                    "@rotation":[1,0,0,0.52],
                    "-children":[
                      { "Shape":
                        {
                          "-geometry":
                            { "Cone":
                              {
                              }
                            },
                          "-appearance":
                            { "Appearance":
                              {
                                "@USE":"FIRST_APPEARANCE"
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Adding this Inline reference to another scene superimposes X3D/VRML coordinate system axes."
          },
          { "Transform":
            {
              "@scale":[4,4,4],
              "-children":[
                { "Inline":
                  {
                    "@DEF":"CoordinateAxes",
                    "@url":["../../X3dForWebAuthors/Chapter03-Grouping/CoordinateAxes.x3d","http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter03-Grouping/CoordinateAxes.x3d","https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d","../../X3dForWebAuthors/Chapter03-Grouping/CoordinateAxes.wrl","http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter03-Grouping/CoordinateAxes.wrl","https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl"]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}