{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.2",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.2.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"PoolMontereyPeninsulaCollegeUsingBoxes.x3d"
          },
          {
            "@name":"description",
            "@content":"Monterey Peninsula College (MPC) swimming pool, simplest model"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman and MV3204 class"
          },
          {
            "@name":"created",
            "@content":"9 April 2010"
          },
          {
            "@name":"modified",
            "@content":"2 December 2024"
          },
          {
            "@name":"info",
            "@content":"Includes trace diagnostic for changing user navigation from EXAMINE to FLY when binding/unbinding the initial overhead-perspective Viewpoint"
          },
          {
            "@name":"reference",
            "@content":"TODO information about ROV races"
          },
          {
            "@name":"drawing",
            "@content":"PoolMontereyPeninsulaCollegeSketch"
          },
          {
            "@name":"Image",
            "@content":"PoolMontereyPeninsulaCollegeDiagram.png"
          },
          {
            "@name":"Image",
            "@content":"PoolMontereyPeninsulaCollegeDiagram.vsd"
          },
          {
            "@name":"photo",
            "@content":"TODO photo(s) of pool"
          },
          {
            "@name":"subject",
            "@content":"X3D swimming pool"
          },
          {
            "@name":"warning",
            "@content":"under development"
          },
          {
            "@name":"reference",
            "@content":"PoolMontereyPeninsulaCollege.x3d"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/Locations/MontereyPeninsulaCollege/PoolMontereyPeninsulaCollegeUsingBoxes.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"21 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":[
          {
            "#comment":"Put CoordinateAxes with correct directional alignment at pool origin"
          },
          { "WorldInfo":
            {
              "@title":"PoolMontereyPeninsulaCollegeUsingBoxes.x3d"
            }
          },
          { "Inline":
            {
              "@DEF":"CoordinateAxes",
              "@url":["../../Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","../../Tools/Authoring/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl"]
            }
          },
          {
            "#comment":"Only one NavInfo can be bound at a time. Include \"ANY\" to allow user override."
          },
          {
            "#comment":"Note that our local units here are still meters."
          },
          { "NavigationInfo":
            {
              "@DEF":"NavigationExamineMode",
              "@avatarSize":[0.25,1.6,2],
              "@speed":5,
              "@type":["EXAMINE","FLY","ANY"]
            }
          },
          { "NavigationInfo":
            {
              "@DEF":"NavigationWalkMode",
              "@avatarSize":[0.25,1.6,2],
              "@speed":5,
              "@type":["WALK","ANY"]
            }
          },
          { "NavigationInfo":
            {
              "@DEF":"NavigationFlyMode",
              "@avatarSize":[0.25,1.6,2],
              "@speed":5,
              "@type":["FLY","ANY"]
            }
          },
          {
            "#comment":"TODO add a deck around the edge of the pool to allow WALKing around"
          },
          {
            "#comment":"All pool model measurements are in feet, therefore scale them into meters. X is length, Y is height, Z is width."
          },
          { "Transform":
            {
              "@DEF":"ScaleFeetToMeters",
              "@scale":[0.305,0.305,0.305],
              "-children":[
                {
                  "#comment":"Box centers are at local coordinate 0 0 0, this translation shifts them to put corner at pool coordinate 0 0 0"
                },
                {
                  "#comment":"Viewpoints are placed here since their position is recorded in feet using the pool coordinate system"
                },
                { "Viewpoint":
                  {
                    "@DEF":"ViewOverhead",
                    "@centerOfRotation":[37.5,0,32],
                    "@description":"High above looking down from 100 feet above",
                    "@orientation":[1,0,0,-1.5708],
                    "@position":[37.5,100,32]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"isBound",
                    "@fromNode":"ViewOverhead",
                    "@toField":"set_bind",
                    "@toNode":"NavigationExamineMode"
                  }
                },
                { "Group":
                  {
                    "-children":[
                      {
                        "#comment":"======= ROUTE Trace =============================================="
                      },
                      { "Script":
                        {
                          "@DEF":"Trace_ROUTE_ViewOverhead_isBound_TO_NavigationExamineMode_set_bind",
                          "@mustEvaluate":true,
                          "-children":[
                            {
                              "#comment":"Trace ROUTEd values on X3D browser console"
                            }
                          ],
                          "field": [
                            {
                              "@name":"reportInterval",
                              "@accessType":"initializeOnly",
                              "@appinfo":"Sampling frequency in seconds (0 means all values)",
                              "@type":"SFTime",
                              "@value":1.0
                            },
                            {
                              "@name":"traceValue",
                              "@accessType":"inputOutput",
                              "@type":"SFBool",
                              "@value":true
                            },
                            {
                              "@name":"timeStampPreviousReport",
                              "@accessType":"initializeOnly",
                              "@type":"SFTime",
                              "@value":-1
                            }
                          ],
                          "#sourceCode":[
"",
"",
"ecmascript:",
"    function set_traceValue (eventValue, timeStamp)",
"    {",
"        Browser.println ('Script method set_traceValue invoked, which is now handing off to traceValueHandler()...');",
"        traceValueHandler (eventValue, timeStamp);",
"    }",
"    function traceValue (eventValue, timeStamp)",
"    {",
"        Browser.println ('Script method traceValue invoked, which is now handing off to traceValueHandler()...');",
"        traceValueHandler (eventValue, timeStamp);",
"    }",
"    function traceValueHandler (eventValue, timeStamp)",
"    {",
"      // input eventValue received for trace field",
"      if (timeStamp - timeStampPreviousReport >= reportInterval) {",
"        Browser.println ('Trace_ROUTE_ViewOverhead_isBound_TO_NavigationExamineMode_set_bind type=SFBool value=' + eventValue);",
"        timeStampPreviousReport = timeStamp;",
"        if  (eventValue == true)",
"             Browser.println ('User navigation should be EXAMINE');",
"        else Browser.println ('User navigation should be FLY');",
"      }",
"    }",
"    function timeOfDay (someTime) {",
"      hh = Math.floor (someTime /(60*60)) % 24;",
"      mm = Math.floor (someTime / 60)     % 60;",
"      ss = Math.floor (someTime)          % 60;",
"      if (hh < 9) hour   = '0' + hh;",
"      else        hour   =       hh;",
"      if (mm < 9) minute = '0' + mm;",
"      else        minute =       mm;",
"      if (ss < 9) second = '0' + ss;",
"      else        second =       ss;",
"      return '(' + hour + ':' + minute + ':' + second + ' GMT)';",
"    }",
"",
""
]
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"isBound",
                          "@fromNode":"ViewOverhead",
                          "@toField":"traceValue",
                          "@toNode":"Trace_ROUTE_ViewOverhead_isBound_TO_NavigationExamineMode_set_bind"
                        }
                      },
                      {
                        "#comment":"======= ROUTE Trace block complete ====================================================="
                      }
                    ]
                  }
                },
                {
                  "#comment":"other Viewpoints do not get EXAMINE navigation type"
                },
                { "Viewpoint":
                  {
                    "@description":"Shallow end left side, from origin",
                    "@orientation":[0.0067,0.9998,0.0161,-2.3563],
                    "@position":[-12,6,-12]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Pool center left side",
                    "@orientation":[0,0.9955,0.0949,3.1413],
                    "@position":[37.52,10,-20]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Deep end left side",
                    "@orientation":[-0.0203,0.9988,0.0451,2.2984],
                    "@position":[87,6,-12]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Deep end center",
                    "@orientation":[-0.0857,0.9926,0.0857,1.5782],
                    "@position":[95,10,32]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Deep end right side",
                    "@orientation":[-0.1001,0.994,0.0449,0.8487],
                    "@position":[87,6,76]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Pool center right side",
                    "@orientation":[-1,0.002,0.0002,0.2235],
                    "@position":[37.52,10,84]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Shallow end right side",
                    "@orientation":[0.1001,0.994,0.0449,-0.8487],
                    "@position":[-12,6,76]
                  }
                },
                { "Viewpoint":
                  {
                    "@description":"Shallow end center",
                    "@orientation":[0.0864,0.99251,0.0864,-1.578318],
                    "@position":[-20,10,32]
                  }
                },
                { "Transform":
                  {
                    "@DEF":"ShiftBoxCornersToPoolCenter",
                    "@translation":[37.5,-12.75,32],
                    "-children":[
                      { "Shape":
                        {
                          "@DEF":"PoolFloor",
                          "-geometry":
                            { "Box":
                              {
                                "@size":[75,0.25,64]
                              }
                            },
                          "-appearance":
                            { "Appearance":
                              {
                                "@DEF":"AppearanceWall",
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.5,0.9,0.9]
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"ShallowWall",
                          "@translation":[-37.5,6.25,0],
                          "-children":[
                            { "Shape":
                              {
                                "@DEF":"ShortWall",
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[0.25,12.75,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepWall",
                          "@translation":[37.5,6.25,0],
                          "-children":[
                            { "Shape":
                              {
                                "@USE":"ShortWall"
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"LeftWall",
                          "@translation":[0,6.25,-32],
                          "-children":[
                            { "Shape":
                              {
                                "@DEF":"LongWall",
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[75,12.75,0.25]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"RightWall",
                          "@translation":[0,6.25,32],
                          "-children":[
                            { "Shape":
                              {
                                "@USE":"LongWall"
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepFloor",
                          "@rotation":[0,0,1,0.1732],
                          "@translation":[32.5,0.9,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[10.152,0.25,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepFloor2",
                          "@rotation":[0,0,1,-0.2085],
                          "@translation":[21,1.4,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[13.288,0.25,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepFloor3",
                          "@rotation":[0,0,1,-0.2783],
                          "@translation":[7.5,4.75,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[14.560,0.25,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepFloor4",
                          "@rotation":[0,0,1,-0.0476],
                          "@translation":[-10,7.25,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[21.024,0.25,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"DeepFloor5",
                          "@rotation":[0,0,1,-0.0588],
                          "@translation":[-29,8.25,0],
                          "-children":[
                            { "Shape":
                              {
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[17.029,0.25,64]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "@USE":"AppearanceWall"
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}