{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.0",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.0.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"SingleTypeConversionExample.x3d"
          },
          {
            "@name":"description",
            "@content":"Converts from a single typed value to various other types of values."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman, Mike Hunsberger, Jane Wu"
          },
          {
            "@name":"created",
            "@content":"8 June 2003"
          },
          {
            "@name":"modified",
            "@content":"28 November 2019"
          },
          {
            "@name":"subject",
            "@content":"type conversion"
          },
          {
            "@name":"Image",
            "@content":"SingleTypeConversionExampleDisplayBegin.png"
          },
          {
            "@name":"Image",
            "@content":"SingleTypeConversionExampleDisplayEnd.png"
          },
          {
            "@name":"reference",
            "@content":"http://www.cs.brown.edu/~gss/VRML98/paper.rev.html"
          },
          {
            "@name":"reference",
            "@content":"http://www.cs.brown.edu/~gss/vrml/hprotos.wrl"
          },
          {
            "@name":"reference",
            "@content":"http://www.cs.brown.edu/~gss/vrml/hotpot.zip"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/SingleTypeConversionExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"26 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":"SingleTypeConversionExample.x3d"
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"SingleTypeConversion",
              "@appinfo":"SingleTypeConversion converts from a single typed value to various other types of values",
              "@url":["SingleTypeConversionPrototype.x3d#SingleTypeConversion","../../../Savage/Tools/Authoring/SingleTypeConversionPrototype.x3d#SingleTypeConversion","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/SingleTypeConversionPrototype.x3d#SingleTypeConversion","SingleTypeConversionPrototype.wrl#SingleTypeConversion","../../../Savage/Tools/Authoring/SingleTypeConversionPrototype.wrl#SingleTypeConversion","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/SingleTypeConversionPrototype.wrl#SingleTypeConversion"],
              "field": [
                {
                  "@name":"decimalPlaces",
                  "@accessType":"initializeOnly",
                  "@appinfo":"decimalPlaces is the number of significant digits after the decimal point, use -1 to indicate no round off",
                  "@type":"SFInt32"
                },
                {
                  "@name":"setDecimalPlaces",
                  "@accessType":"inputOnly",
                  "@type":"SFInt32"
                },
                {
                  "@name":"BooleanValue",
                  "@accessType":"inputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"FloatValue",
                  "@accessType":"inputOnly",
                  "@type":"SFFloat"
                },
                {
                  "@name":"IntegerValue",
                  "@accessType":"inputOnly",
                  "@type":"SFInt32"
                },
                {
                  "@name":"TimeValue",
                  "@accessType":"inputOnly",
                  "@type":"SFTime"
                },
                {
                  "@name":"BooleanResult",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"FloatResult",
                  "@accessType":"outputOnly",
                  "@type":"SFFloat"
                },
                {
                  "@name":"IntegerResult",
                  "@accessType":"outputOnly",
                  "@type":"SFInt32"
                },
                {
                  "@name":"TimeResult",
                  "@accessType":"outputOnly",
                  "@type":"SFTime"
                },
                {
                  "@name":"StringResult",
                  "@accessType":"outputOnly",
                  "@type":"SFString"
                },
                {
                  "@name":"StringsResult",
                  "@accessType":"outputOnly",
                  "@type":"MFString"
                }
              ]
            }
          },
          {
            "#comment":"===================="
          },
          { "Group":
            {
              "-children":[
                { "Transform":
                  {
                    "@translation":[0,2,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.1,0.6,0.1]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Text":
                              {
                                "@string":["Example prototype use","SingleTypeConversion"],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@DEF":"MIDDLE_MIDDLE",
                                      "@justify":["MIDDLE","MIDDLE"],
                                      "@size":0.75
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[0,-0.25,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0,0.35,0.4]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Text":
                              {
                                "@string":["Integer 23 and a float counter","are converted into text below"],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@USE":"MIDDLE_MIDDLE"
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                },
                { "TimeSensor":
                  {
                    "@DEF":"ClockTrigger",
                    "@cycleInterval":0.5,
                    "@loop":true
                  }
                },
                { "BooleanTrigger":
                  {
                    "@DEF":"ConvertTimeToBoolean"
                  }
                },
                { "IntegerTrigger":
                  {
                    "@DEF":"TriggerNode",
                    "@integerKey":23
                  }
                },
                { "ProtoInstance":
                  {
                    "@name":"SingleTypeConversion",
                    "@DEF":"IntegerConverter"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"cycleTime",
                    "@fromNode":"ClockTrigger",
                    "@toField":"set_triggerTime",
                    "@toNode":"ConvertTimeToBoolean"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"triggerTrue",
                    "@fromNode":"ConvertTimeToBoolean",
                    "@toField":"set_boolean",
                    "@toNode":"TriggerNode"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"triggerValue",
                    "@fromNode":"TriggerNode",
                    "@toField":"IntegerValue",
                    "@toNode":"IntegerConverter"
                  }
                },
                { "Transform":
                  {
                    "@translation":[-1.8,-2.5,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.8,0,0]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Text":
                              {
                                "@DEF":"IntegerText",
                                "@string":["__"],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@DEF":"BEGIN_MIDDLE",
                                      "@justify":["BEGIN","MIDDLE"]
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"StringsResult",
                          "@fromNode":"IntegerConverter",
                          "@toField":"set_string",
                          "@toNode":"IntegerText"
                        }
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[0.2,-2.5,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.8,0,0]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Text":
                              {
                                "@DEF":"FloatText",
                                "@string":["_._"],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@USE":"BEGIN_MIDDLE"
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "TimeSensor":
                        {
                          "@DEF":"FloatClock",
                          "@cycleInterval":5,
                          "@loop":true
                        }
                      },
                      { "ScalarInterpolator":
                        {
                          "@DEF":"FloatCounter",
                          "@key":[0,0.2,0.4,1],
                          "@keyValue":[23.000,23.000,45.67,45.67]
                        }
                      },
                      { "ProtoInstance":
                        {
                          "@name":"SingleTypeConversion",
                          "@DEF":"FloatConverter",
                          "fieldValue": [
                            {
                              "@name":"decimalPlaces",
                              "@value":2
                            }
                          ]
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"fraction_changed",
                          "@fromNode":"FloatClock",
                          "@toField":"set_fraction",
                          "@toNode":"FloatCounter"
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"value_changed",
                          "@fromNode":"FloatCounter",
                          "@toField":"FloatValue",
                          "@toNode":"FloatConverter"
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"StringsResult",
                          "@fromNode":"FloatConverter",
                          "@toField":"set_string",
                          "@toNode":"FloatText"
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}