{ "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":"FishPrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"This is a reusable prototype of a generic fish, which can be configured upon instancing to create customized fish."
          },
          {
            "@name":"warning",
            "@content":"Circular fish behavior is embedded in prototype, instead the circular path needs to be used in external files or possibly parameterized."
          },
          {
            "@name":"creator",
            "@content":"Ildeniz Duman"
          },
          {
            "@name":"translator",
            "@content":"Scott Tufts"
          },
          {
            "@name":"created",
            "@content":"1 June 1998"
          },
          {
            "@name":"translated",
            "@content":"9 December 2001"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/FishPrototype.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":[
          { "WorldInfo":
            {
              "@title":"FishPrototype.x3d"
            }
          },
          { "ProtoDeclare":
            {
              "@name":"Fish",
              "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.7,0.7,0.7]
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Transform":
                      {
                        "@DEF":"FishTransform",
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"scale",
                                "@protoField":"fishScale"
                              }
                            ]
                        },
                        "-children":[
                          { "Transform":
                            {
                              "@DEF":"Way",
                              "-children":[
                                { "Transform":
                                  {
                                    "@translation":[4,0,0],
                                    "-children":[
                                      { "Transform":
                                        {
                                          "@rotation":[1,0,0,1.57],
                                          "-children":[
                                            { "Shape":
                                              {
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "-material":
                                                        { "Material":
                                                          {
                                                            "@DEF":"FishColor",
                                                            "IS": {
                                                                "connect": [
                                                                  {
                                                                    "@nodeField":"diffuseColor",
                                                                    "@protoField":"fishColor"
                                                                  }
                                                                ]
                                                            }
                                                          }
                                                        },
                                                      "-texture":
                                                        { "ImageTexture":
                                                          {
                                                            "@DEF":"FishTexture",
                                                            "IS": {
                                                                "connect": [
                                                                  {
                                                                    "@nodeField":"url",
                                                                    "@protoField":"skinTextureUrl"
                                                                  }
                                                                ]
                                                            }
                                                          }
                                                        }
                                                    }
                                                  },
                                                "-geometry":
                                                  { "Extrusion":
                                                    {
                                                      "@DEF":"FishShape",
                                                      "@creaseAngle":1.57,
                                                      "@crossSection":[1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00],
                                                      "@scale":[0.03,0.03,0.1,0.15,0.4,0.7,0.5,0.75,0.4,0.55,0.2,0.3,0.05,0.1,0.03,0.6],
                                                      "@spine":[0,3.51,0,0,3.50,0,0,2.80,0,0,2.3,0,0,1.5,0,0,0.5,0,0,0,0,0,-0.6,0]
                                                    }
                                                  }
                                              }
                                            },
                                            { "Shape":
                                              {
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "@DEF":"FinSkin",
                                                      "-material":
                                                        { "Material":
                                                          {
                                                            "@diffuseColor":[0.7,0.7,0.7],
                                                            "@transparency":0.3
                                                          }
                                                        }
                                                    }
                                                  },
                                                "-geometry":
                                                  { "IndexedFaceSet":
                                                    {
                                                      "@coordIndex":[0,1,2,3,-1],
                                                      "@solid":false,
                                                      "-coord":
                                                        { "Coordinate":
                                                          {
                                                            "@DEF":"Pelvic",
                                                            "@point":[0,2.2,0.6,0,2.2,-0.7,0,0.3,-0.3,0,0.7,0.5]
                                                          }
                                                        }
                                                    }
                                                  }
                                              }
                                            },
                                            { "Transform":
                                              {
                                                "@translation":[0.3,2.8,-0.4],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "@DEF":"Eye",
                                                      "-appearance":
                                                        { "Appearance":
                                                          {
                                                            "-material":
                                                              { "Material":
                                                                {
                                                                  "@diffuseColor":[0.5,0.5,0.5],
                                                                  "@shininess":1,
                                                                  "@specularColor":[0.3,0.3,0.3]
                                                                }
                                                              }
                                                          }
                                                        },
                                                      "-geometry":
                                                        { "Sphere":
                                                          {
                                                            "@radius":0.08
                                                          }
                                                        }
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            { "Transform":
                                              {
                                                "@translation":[-0.3,2.8,-0.4],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "@USE":"Eye"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            { "Transform":
                                              {
                                                "@scale":[2.6,1,0.7],
                                                "@translation":[0,3.44,-0.1],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "@USE":"Eye"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            { "Transform":
                                              {
                                                "@DEF":"LeftPectoral",
                                                "@translation":[-0.3,2.7,0.1],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "-appearance":
                                                        { "Appearance":
                                                          {
                                                            "@USE":"FinSkin"
                                                          }
                                                        },
                                                      "-geometry":
                                                        { "IndexedFaceSet":
                                                          {
                                                            "@coordIndex":[0,1,2,-1],
                                                            "@solid":false,
                                                            "-coord":
                                                              { "Coordinate":
                                                                {
                                                                  "@point":[0,0,0,-0.5,-0.2,0.1,-0.25,0.2,0.25]
                                                                }
                                                              }
                                                          }
                                                        }
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            { "Transform":
                                              {
                                                "@DEF":"RightPectoral",
                                                "@translation":[0.3,2.7,0.1],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "-appearance":
                                                        { "Appearance":
                                                          {
                                                            "@USE":"FinSkin"
                                                          }
                                                        },
                                                      "-geometry":
                                                        { "IndexedFaceSet":
                                                          {
                                                            "@coordIndex":[0,1,2,-1],
                                                            "@solid":false,
                                                            "-coord":
                                                              { "Coordinate":
                                                                {
                                                                  "@point":[0,0,0,0.5,-0.2,0.1,0.25,0.2,0.25]
                                                                }
                                                              }
                                                          }
                                                        }
                                                    }
                                                  }
                                                ]
                                              }
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          },
                          { "Group":
                            {
                              "@DEF":"AnimationGroup",
                              "-children":[
                                { "TimeSensor":
                                  {
                                    "@DEF":"RouteTImer",
                                    "@cycleInterval":50,
                                    "@loop":true
                                  }
                                },
                                { "TimeSensor":
                                  {
                                    "@DEF":"Timer",
                                    "@cycleInterval":1.5,
                                    "@loop":true
                                  }
                                },
                                { "CoordinateInterpolator":
                                  {
                                    "@DEF":"Waggler",
                                    "@key":[0.0,0.5,1.0],
                                    "@keyValue":[0,3.55,0,0,3.50,0,0,2.80,0,0,2.3,0,-0.05,1.5,0,0.1,0.5,0,0.2,0,0,0.3,-0.6,0,0,3.55,0,0,3.50,0,0,2.80,0,0,2.3,0,0.05,1.5,0,-0.1,0.5,0,-0.2,0,0,-0.3,-0.6,0,0,3.55,0,0,3.50,0,0,2.80,0,0,2.3,0,-0.05,1.5,0,0.1,0.5,0,0.2,0,0,0.3,-0.6,0]
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"fraction_changed",
                                    "@fromNode":"Timer",
                                    "@toField":"set_fraction",
                                    "@toNode":"Waggler"
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"value_changed",
                                    "@fromNode":"Waggler",
                                    "@toField":"set_spine",
                                    "@toNode":"FishShape"
                                  }
                                },
                                { "CoordinateInterpolator":
                                  {
                                    "@DEF":"Points",
                                    "@key":[0.0,0.5,1.0],
                                    "@keyValue":[0,2.2,0.6,0,2.2,-0.7,0.2,0.3,-0.3,0.2,0.7,0.5,0,2.2,0.6,0,2.2,-0.7,-0.2,0.3,-0.3,-0.2,0.7,0.5,0,2.2,0.6,0,2.2,-0.7,0.2,0.3,-0.3,0.2,0.7,0.5]
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"fraction_changed",
                                    "@fromNode":"Timer",
                                    "@toField":"set_fraction",
                                    "@toNode":"Points"
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"value_changed",
                                    "@fromNode":"Points",
                                    "@toField":"set_point",
                                    "@toNode":"Pelvic"
                                  }
                                },
                                { "OrientationInterpolator":
                                  {
                                    "@DEF":"LeftPectoralRotation",
                                    "@key":[0,0.3,0.7,1],
                                    "@keyValue":[0,1,0,0.523,0,1,0,0,0,1,0,0,0,1,0,0.523]
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"fraction_changed",
                                    "@fromNode":"Timer",
                                    "@toField":"set_fraction",
                                    "@toNode":"LeftPectoralRotation"
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"value_changed",
                                    "@fromNode":"LeftPectoralRotation",
                                    "@toField":"set_rotation",
                                    "@toNode":"LeftPectoral"
                                  }
                                },
                                { "OrientationInterpolator":
                                  {
                                    "@DEF":"RightPectoralRotation",
                                    "@key":[0,0.3,0.7,1],
                                    "@keyValue":[0,1,0,-0.523,0,1,0,0,0,1,0,0,0,1,0,-0.523]
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"fraction_changed",
                                    "@fromNode":"Timer",
                                    "@toField":"set_fraction",
                                    "@toNode":"RightPectoralRotation"
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"value_changed",
                                    "@fromNode":"RightPectoralRotation",
                                    "@toField":"set_rotation",
                                    "@toNode":"RightPectoral"
                                  }
                                },
                                { "OrientationInterpolator":
                                  {
                                    "@DEF":"Turn",
                                    "@key":[0,0.25,0.5,0.75,1],
                                    "@keyValue":[0,1,0,0,0,1,0,-1.57,0,1,0,-3.14,0,1,0,-4.71,0,1,0,0]
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"fraction_changed",
                                    "@fromNode":"RouteTImer",
                                    "@toField":"set_fraction",
                                    "@toNode":"Turn"
                                  }
                                },
                                { "ROUTE":
                                  {
                                    "@fromField":"value_changed",
                                    "@fromNode":"Turn",
                                    "@toField":"set_rotation",
                                    "@toNode":"Way"
                                  }
                                }
                              ]
                            }
                          }
                        ]
                      }
                    }
                  ]
              }
            }
          },
          {
            "#comment":"===================="
          },
          { "ProtoInstance":
            {
              "@name":"Fish"
            }
          }
        ]
    }
  }
}