{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@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":"CircleFishLodPrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"Modifies an externally defined CircleFish prototype by adding Level of Detail (LOD)"
          },
          {
            "@name":"creator",
            "@content":"Ildeniz Duman"
          },
          {
            "@name":"translator",
            "@content":"Scott Tufts"
          },
          {
            "@name":"created",
            "@content":"1998"
          },
          {
            "@name":"translated",
            "@content":"11 December 2001"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodPrototype.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"17 April 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":[
          { "ExternProtoDeclare":
            {
              "@name":"CircleFish",
              "@appinfo":"Simple model of a fish swimming in a cirlce",
              "@url":["CircleFishPrototype.x3d#CircleFish","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d#CircleFish","CircleFishPrototype.wrl#CircleFish","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.wrl#CircleFish"],
              "field": [
                {
                  "@name":"skinTextureUrl",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                },
                {
                  "@name":"fishScale",
                  "@accessType":"inputOutput",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"fishColor",
                  "@accessType":"inputOutput",
                  "@type":"SFColor"
                },
                {
                  "@name":"finColor",
                  "@accessType":"inputOutput",
                  "@type":"SFColor"
                },
                {
                  "@name":"positionKey",
                  "@accessType":"inputOutput",
                  "@type":"MFFloat"
                },
                {
                  "@name":"positionKeyValue",
                  "@accessType":"inputOutput",
                  "@type":"MFVec3f"
                },
                {
                  "@name":"orientationKey",
                  "@accessType":"inputOutput",
                  "@type":"MFFloat"
                },
                {
                  "@name":"orientationKeyValue",
                  "@accessType":"inputOutput",
                  "@type":"MFRotation"
                },
                {
                  "@name":"orbitTime",
                  "@accessType":"inputOutput",
                  "@type":"SFTime"
                }
              ]
            }
          },
          {
            "#comment":"new LOD prototype extends a previously defined prototype"
          },
          { "ProtoDeclare":
            {
              "@name":"CircleFishLod",
              "@appinfo":"CircleFish prototype with LOD added",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"skinTextureUrl",
                      "@accessType":"inputOutput",
                      "@type":"MFString"
                    },
                    {
                      "@name":"fishScale",
                      "@accessType":"inputOutput",
                      "@type":"SFVec3f",
                      "@value":[1,1,1]
                    },
                    {
                      "@name":"fishColor",
                      "@accessType":"inputOutput",
                      "@type":"SFColor",
                      "@value":[0.5,0.5,0.5]
                    },
                    {
                      "@name":"finColor",
                      "@accessType":"inputOutput",
                      "@type":"SFColor",
                      "@value":[0.5,0.5,0.5]
                    },
                    {
                      "@name":"positionKey",
                      "@accessType":"inputOutput",
                      "@type":"MFFloat",
                      "@value":[0.0,0.125,0.25,0.375,0.5,0.625,0.750,0.875,1]
                    },
                    {
                      "@name":"positionKeyValue",
                      "@accessType":"inputOutput",
                      "@type":"MFVec3f",
                      "@value":[1.5,0.5,0,1.3,0,-0.8,0,-0.5,-1.0,-1.3,0,-0.8,-1.5,0.5,0,-1.3,0,0.8,0,-0.5,1.0,1.3,0,0.8,1.5,0.5,0]
                    },
                    {
                      "@name":"orientationKey",
                      "@accessType":"inputOutput",
                      "@type":"MFFloat",
                      "@value":[0.0,0.25,0.5,0.750,1]
                    },
                    {
                      "@name":"orientationKeyValue",
                      "@accessType":"inputOutput",
                      "@type":"MFRotation",
                      "@value":[0,1,0,-3.14,0,1,0,-1.57,0,1,0,0,0,1,0,1.57,0,1,0,3.14]
                    },
                    {
                      "@name":"orbitTime",
                      "@accessType":"inputOutput",
                      "@type":"SFTime",
                      "@value":45
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "LOD":
                      {
                        "@forceTransitions":true,
                        "@range":[20,40],
                        "-children":[
                          { "ProtoInstance":
                            {
                              "@name":"CircleFish",
                              "@DEF":"NearInstance",
                              "IS": {
                                  "connect": [
                                    {
                                      "@nodeField":"skinTextureUrl",
                                      "@protoField":"skinTextureUrl"
                                    },
                                    {
                                      "@nodeField":"fishScale",
                                      "@protoField":"fishScale"
                                    },
                                    {
                                      "@nodeField":"fishColor",
                                      "@protoField":"fishColor"
                                    },
                                    {
                                      "@nodeField":"finColor",
                                      "@protoField":"finColor"
                                    },
                                    {
                                      "@nodeField":"positionKey",
                                      "@protoField":"positionKey"
                                    },
                                    {
                                      "@nodeField":"positionKeyValue",
                                      "@protoField":"positionKeyValue"
                                    },
                                    {
                                      "@nodeField":"orientationKey",
                                      "@protoField":"orientationKey"
                                    },
                                    {
                                      "@nodeField":"orientationKeyValue",
                                      "@protoField":"orientationKeyValue"
                                    },
                                    {
                                      "@nodeField":"orbitTime",
                                      "@protoField":"orbitTime"
                                    }
                                  ]
                              }
                            }
                          },
                          { "ProtoInstance":
                            {
                              "@name":"CircleFish",
                              "@DEF":"MidRangeInstance",
                              "-children":[
                                {
                                  "#comment":"no skinTexture at midRange for better performance"
                                }
                              ],
                              "IS": {
                                  "connect": [
                                    {
                                      "@nodeField":"fishScale",
                                      "@protoField":"fishScale"
                                    },
                                    {
                                      "@nodeField":"fishColor",
                                      "@protoField":"fishColor"
                                    },
                                    {
                                      "@nodeField":"finColor",
                                      "@protoField":"finColor"
                                    },
                                    {
                                      "@nodeField":"positionKey",
                                      "@protoField":"positionKey"
                                    },
                                    {
                                      "@nodeField":"positionKeyValue",
                                      "@protoField":"positionKeyValue"
                                    },
                                    {
                                      "@nodeField":"orientationKey",
                                      "@protoField":"orientationKey"
                                    },
                                    {
                                      "@nodeField":"orientationKeyValue",
                                      "@protoField":"orientationKeyValue"
                                    },
                                    {
                                      "@nodeField":"orbitTime",
                                      "@protoField":"orbitTime"
                                    }
                                  ]
                              }
                            }
                          },
                          {
                            "#comment":"Disappear at far range"
                          },
                          { "WorldInfo":
                            {
                              "@info":["null node"]
                            }
                          }
                        ]
                      }
                    }
                  ]
              }
            }
          },
          {
            "#comment":"===================="
          },
          { "Anchor":
            {
              "@description":"CircleFishLod Example",
              "@parameter":["target=_blank"],
              "@url":["CircleFishLodExample.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodExample.x3d","CircleFishLodExample.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodExample.wrl"],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0,1,1],
                                "@emissiveColor":[0,1,1]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Text":
                        {
                          "@string":["CircleFishLodPrototype","is a Prototype declaration file.","To see an example using this new node,","click this text and view","CircleFishLodExample scene"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"],
                                "@size":0.7
                              }
                            }
                        }
                      }
                  }
                },
                {
                  "#comment":"Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip"
                },
                { "Shape":
                  {
                    "-geometry":
                      { "Box":
                        {
                          "@size":[12,5,0.001]
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@transparency":1
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}