X3D Model Documentation: ChartletTranscribed.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent=' ChartletTranscribed.x3d '/>
  6            <meta name='descriptioncontent='Manually derived bathymetry offshore Camp Pendleton California.'/>
  7            <meta name='creatorcontent='Don Brutzman and OS3 Bruce Goldin USN'/>
  8            <meta name='createdcontent='16 March 2001'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribed.x3d '/>
 11            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 12            <meta name='licensecontent='../../license.html'/>
 13       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: BathymetryGrid, BathymetryGridColorNodeCalculated, CalculateColorSchemeMEDAL, CoordinateAxes, GridXZ_20x20Fixed

Index for Viewpoint node: Viewpoint_1
-->
 14       <Scene>
 15            <WorldInfo title='ChartletTranscribed.x3d'/>
 16            <Background groundColor='0.2 0.2 0.5skyColor='0.4 0.4 1'/>
 17            <DirectionalLight direction='0 -1 0'/>
 18            <NavigationInfo speed='100type='"EXAMINE" "WALK" "FLY" "ANY"'/>
 19            <Transform rotation='0 1 0 -1.57translation='-2000 1000 2464'>
 20                 <Viewpoint description='Chartlet vieworientation='1 0 0 -0.3'/>
 21            </Transform>
 22            <!-- Soundings in feet, converted to meters (1m = 39.3", 39.3" / 12" = 3.275). -->
 23            <Switch whichChoice='0'>
 24                 <!-- Simple ElevationGrid, not georeferenced to latitude/longitude -->
 25                 <Group>
 26                      <Transform scale='1 3.275 1'>
 27                           <Shape>
 28 
                              <!-- ROUTE information for BathymetryGrid node:  [from CalculateColorSchemeMEDAL.heightValuesOutput to set_height ] -->
                              <ElevationGrid DEF='BathymetryGridcreaseAngle='3.14solid='falsexDimension='31xSpacing='154zDimension='29zSpacing='184'>
 29 
                                   <!-- ROUTE information for BathymetryGridColorNodeCalculated node:  [from CalculateColorSchemeMEDAL.colorValuesOutput to set_color ] -->
                                   <Color DEF='BathymetryGridColorNodeCalculatedcolor='0 0 0'/>
 30                                </ElevationGrid>
 31                                <Appearance>
 32                                     <Material diffuseColor='0 0 0.25'/>
 33                                </Appearance>
 34                           </Shape>
 35 
                         <!-- ROUTE information for CalculateColorSchemeMEDAL node:  [from heightValuesOutput to BathymetryGrid.set_height ] [from colorValuesOutput to BathymetryGridColorNodeCalculated.set_color ] -->
                         <Script DEF='CalculateColorSchemeMEDAL'>
 36                                <!-- inputUnits are 'feet' or 'meters' - heightValuesOutput is always in meters. -->
 37                                <field name='inputUnitstype='SFStringvalue='feetaccessType='initializeOnly'/>
 38                                <field name='heightValuestype='MFFloatvalue='-101 -90 -84 -78 -72 -72 -70 -65 -62 -63 -55 -53 -50 -50 -47 -45 -45 -43 -42 -41 -38 -37 -37 -36 -34 -31 -31 -27 -26 -25 -23 -101 -90 -84 -78 -72 -72 -66 -66 -64 -58 -55 -53 -50 -48 -46 -45 -43 -42 -42 -39 -39 -37 -36 -34 -32 -31 -27 -26 -21 -24 -19 -86 -84 -78 -73 -72 -66 -66 -61 -57 -55 -52 -49 -48 -46 -45 -46 -45 -38 -38 -36 -33 -32 -32 -31 -30 -30 -25 -24 -22 -15 -9 -84 -78 -75 -72 -66 -65 -63 -58 -55 -53 -49 -47 -47 -45 -43 -42 -40 -39 -37.5 -35.5 -34 -32.5 -31 -32 -28 -26 -24 -21 -20 -8.5 -5 -79 -72 -70 -66 -66 -60 -57 -54 -52 -49 -48 -46 -44 -43 -43 -40 -40 -39 -36 -34 -33 -32 -31 -28 -26 -24 -22 -20 -10 -5 0 -81 -72 -66 -63 -60 -58 -57 -54 -51 -49 -46 -46 -44 -42 -41 -40 -40 -41 -35.5 -35 -33 -31 -28 -27 -25 -23 -18 -13 -5 0 0 -72 -66 -64.5 -60 -59 -55 -54 -52 -48 -48 -45 -44 -42 -42 -41 -40 -39.5 -38 -36 -35 -34 -29 -28 -24 -23 -18 -12 -5 0 0 0 -70 -65 -62 -61 -54 -54 -51 -49 -48 -45 -45 -44 -43 -40 -39.7 -39 -38 -35 -34 -33 -31 -28.7 -26 -23 -19 -14 -5 0 0 0 0 -63 -61 -60 -55 -54 -51 -50 -50 -47 -44 -43 -41 -39 -38 -37 -36 -36 -36 -33 -33 -31 -27 -24 -19 -12 -5 0 0 0 0 0 -60 -59 -55 -53 -50 -50 -49 -48 -45 -44 -41 -39.5 -39 -37 -36.5 -36 -34 -34 -32 -30.5 -29 -27 -20 -15 -8 -2 0 0 0 0 0 -58 -56.5 -54 -50 -50 -49 -48 -47 -44 -42 -39 -38.5 -37 -36 -36 -29.7 -33 -32 -31 -29 -27.7 -22 -16 -9 -2 0 0 0 0 0 0 -55 -53 -50 -49 -48 -47 -43 -44 -44 -40 -39 -38 -37 -36 -34 -33.5 -31 -30 -27.5 -26 -23 -17 -11 -2 0 0 0 0 0 0 0 -54 -51 -50 -47 -47 -47 -45 -45 -43 -41 -39 -37 -36 -35 -33 -32 -30 -29 -27 -24.5 -21 -15 -5 0 0 0 0 0 0 0 0 -53 -51 -48 -46 -44 -44.5 -43 -42 -41 -40 -36.5 -35 -34.5 -35 -18 -31 -29 -26 -24 -20 -13 -5 0 0 0 0 0 0 0 0 0 -52 -50 -47 -45 -44 -44 -43 -42 -40 -38 -36.5 -34 -32.5 -31 -31 -29.5 -26.7 -24.5 -20 -13 -7 0 0 0 0 0 0 0 0 0 0 -49.5 -49 -47 -45 -43 -41.5 -40 -39.5 -37.5 -34 -34 -33 -33 -32 -28.5 -28 -26 -21 -15 -8 -1 0 0 0 0 0 0 0 0 0 0 -49 -48 -46 -46 -44 -40 -41 -38.5 -37 -37 -36.5 -33 -32.5 -30 -27 -26 -22 -14 -10 -1 0 0 0 0 0 0 0 0 0 0 0 -47 -46 -45 -45 -44 -41 -40 -38 -37 -34 -33 -32.5 -31 -28.7 -26 -22 -19 -10 -3 0 0 0 0 0 0 0 0 0 0 0 0 -45 -44.5 -42 -42 -42 -40 -39 -37.5 -36 -32.5 -31 -31 -29 -26 -23 -20 -10 -5 0 0 0 0 0 0 0 0 0 0 0 0 0 -44 -45 -40 -40 -39 -38 -37.5 -35 -33 -31.5 -30 -29 -26 -24 -20 -12 -6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -43 -41 -39.5 -39 -38 -36 -35 -32 -32 -30 -28 -27 -24 -20 -12 -5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -40 -39 -39 -39 -36 -34 -32 -31 -30 -27 -26 -24 -20 -12 -5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -39 -38.5 -38 -38 -34 -33 -31 -30 -27 -25 -24 -21 -13 -6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -38 -37 -36.5 -34 -32 -31 -29.7 -28 -26 -24 -20.5 -14 -7 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -37 -37 -33.8 -33 -31 -29 -28.5 -26.7 -25.5 -20 -14 -7 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -34 -39 -33 -31 -29 -27 -27 -24 -21 -16 -7 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -34 -36 -33 -30 -28 -26 -26 -22 -15 -8 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -32 -32 -29 -27.5 -25.7 -25 -23 -15 -8 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -33 -30 -27 -26 -24 -21 -16 -9 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0accessType='initializeOnly'/>
 39                                <field name='heightValuesOutputtype='MFFloataccessType='outputOnly'/>
 40                                <field name='colorValuesOutputtype='MFColoraccessType='outputOnly'/>
  <![CDATA[
            
ecmascript:

function initialize ()
{
	totalHeights=heightValues.length;
	heightValuesHold = new MFFloat (0);
//	Browser.println ('totalHeights=heightValues.length=' + totalHeights);

  // this depth band defined to match fathoms to 60 feet, then 10' increments, doesn't match MEDAL
  depthBand = new MFFloat (0,-6,-12,-18,-24,-30,-36,-42,-48,-54,-60,-70,-80,-90,-100);

  if (inputUnits == 'feet')
  {
	for ( index = 1; index <= totalHeights ; index++ )
	{
		// 1 meter = 39.3 inches
		heightValuesHold[index] = heightValues[index] * (12.0 / 39.3);
	}
	heightValuesOutput = heightValuesHold;
  }
  else
  {
	for ( index = 1; index <= depthBand.length ; index++ )
	{
		// 1 meter = 39.3 inches
		depthBand[index] *= (39.31 / 2.0);
	}
	heightValuesOutput = heightValues;
  }
  brown		= new SFColor (0.2, 0.2, 0);
  white		= new SFColor (1, 1, 1);
  red		= new SFColor (1, 0, 0);
  orange	= new SFColor (1, .529, 0);
  yellow	= new SFColor (1, 1, 0);
  green		= new SFColor (0, 1, 0);
  cyan		= new SFColor (0, 1, 1);
  blue		= new SFColor (0, 0, 1);
  magenta	= new SFColor (1, 0, 1);
  maroon	= new SFColor (0.561, 0, 0.322);
  tan		= new SFColor (0.871, 0.721, 0.529);
  seaGreen	= new SFColor (0.322, 0.584, 0.517);
  slateBlue	= new SFColor (0.494, 0.533, 0.671);
  navyBlue	= new SFColor (0.137, 0.137, 0.459);
  grey		= new SFColor (0.5,   0.5,   0.5);
  slateGrey	= new SFColor (0.439, 0.502, 0.565);
  skyBlue	= new SFColor (0.6, 0.6, 1.0);
  olive		= new SFColor (0.1, 0.4, 0);
  black		= new SFColor (0.1, 0.1, 0.1);

  colorValuesOutput = new MFColor (); // array gets dynamically expanded
  for ( index = 1; index <= totalHeights ; index++ )
  {
	if      (heightValues[index] > depthBand[1])  colorValuesOutput [index] = brown;
	else if (heightValues[index] > depthBand[2])  colorValuesOutput [index] = cyan;
	else if (heightValues[index] > depthBand[3])  colorValuesOutput [index] = red;
	else if (heightValues[index] > depthBand[4])  colorValuesOutput [index] = orange;
	else if (heightValues[index] > depthBand[5])  colorValuesOutput [index] = yellow;
	else if (heightValues[index] > depthBand[6])  colorValuesOutput [index] = tan;
	else if (heightValues[index] > depthBand[7])  colorValuesOutput [index] = grey;
	else if (heightValues[index] > depthBand[8])  colorValuesOutput [index] = olive;
	else if (heightValues[index] > depthBand[9])  colorValuesOutput [index] = green;
	else if (heightValues[index] > depthBand[10]) colorValuesOutput [index] = seaGreen;
	else if (heightValues[index] > depthBand[11]) colorValuesOutput [index] = navyBlue;
	else if (heightValues[index] > depthBand[12]) colorValuesOutput [index] = blue;
	else if (heightValues[index] > depthBand[13]) colorValuesOutput [index] = slateBlue;
	else if (heightValues[index] > depthBand[14]) colorValuesOutput [index] = skyBlue;
	else if (heightValues[index] > depthBand[15]) colorValuesOutput [index] = slateGrey;
	else                                          colorValuesOutput [index] = black;

//	if      (heightValues[index] > depthBand[1])  colorValuesOutput [index] = brown;
//	else if (heightValues[index] > depthBand[2])  colorValuesOutput [index] = yellow;
//	else if (heightValues[index] > depthBand[3])  colorValuesOutput [index] = green;
//	else if (heightValues[index] > depthBand[4])  colorValuesOutput [index] = cyan;
//	else if (heightValues[index] > depthBand[5])  colorValuesOutput [index] = magenta;
//	else if (heightValues[index] > depthBand[6])  colorValuesOutput [index] = tan;
//	else if (heightValues[index] > depthBand[7])  colorValuesOutput [index] = skyBlue;
//	else if (heightValues[index] > depthBand[8])  colorValuesOutput [index] = red;
//	else if (heightValues[index] > depthBand[9])  colorValuesOutput [index] = grey;
//	else if (heightValues[index] > depthBand[10]) colorValuesOutput [index] = seaGreen;
//	else if (heightValues[index] > depthBand[11]) colorValuesOutput [index] = slateBlue;
//	else if (heightValues[index] > depthBand[12]) colorValuesOutput [index] = olive;
//	else if (heightValues[index] > depthBand[13]) colorValuesOutput [index] = black;
//	else if (heightValues[index] > depthBand[14]) colorValuesOutput [index] = navyBlue;
//	else if (heightValues[index] > depthBand[15]) colorValuesOutput [index] = slateGrey;
//	else                                          colorValuesOutput [index] = orange;
  }
}

          
]]>
 42                           </Script>
 43                      </Transform>
 44                      <!-- A new configurable prototype is needed for surface coordinate grids. -->
 45                      <Transform scale='250 250 250translation='2500 0 2500'>
 46                           <Inline DEF='GridXZ_20x20Fixed'   url=' "../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl" '/>
 47                      </Transform>
 48                      <Transform scale='1000 1000 1000'>
 49                           <Inline DEF='CoordinateAxes'   url=' "../../../Savage/Tools/Authoring/CoordinateAxes.x3d" "../../../X3dForWebAuthors/Chapter03Grouping/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" "../../../Savage/Tools/Authoring/CoordinateAxes.wrl" "../../../X3dForWebAuthors/Chapter03Grouping/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" '/>
 50                      </Transform>
 51                 </Group>
 52                 <!-- GeoElevationGrid, georeferenced to latitude/longitude. Switched off, awaiting further work. -->
 53                 <!-- <Shape> <GeoElevationGrid geoGridOrigin="-117.5 33.2666666666667 1000000" geoSystem='"GD" "WE"' solid="false" xDimension="31" xSpacing="154" yScale="3.275" zDimension="29" zSpacing="184"/> </Shape> -->
 54            </Switch>
 55            <!-- HTML Color Codes Black = "#000000" = 0 0 0 Green = "#008000" = 0 0.5 0 Silver = "#C0C0C0" = 0.75 0.75 0.75 Lime = "#00FF00" = 0 1 0 Gray = "#808080" = 0.5 0.5 0.5 Olive = "#808000" = 0.5 0.5 0 White = "#FFFFFF" = 1 1 1 Yellow = "#FFFF00" = 1 1 0 Maroon = "#800000" = 0.5 0 0 Navy = "#000080" = 0 0 0.5 Red = "#FF0000" = 1 0 0 Blue = "#0000FF" = 0 0 1 Purple = "#800080" = 0.5 0 0.5 Teal = "#008080" = 0 0.5 0.5 Fuchsia = "#FF00FF" = 1 0 1 Aqua = "#00FFFF" = 0 1 1 -->
 56            <!-- MEDAL Color Codes depth 0-2m orange 2-3 yellow 3-4 bright green 4-5 cyan 5-6 magenta 6-7 tan 7-8 sky blue 8-9 red 9-10 grey 10-11 teal/seagreen 11-12 slateblue 12-13 olivedrab 13-14 black 14-20 navyblue 20-30 slategrey 0.5 0.5 0 1 0.5 0 1 1 0 0 1 0 0 1 1 1 0 1 0.75 0.75 0 1 0.5 0.5 1 0 0 0.5 0.5 0.5 0 0.5 0.5 0 0 0.25 0.5 0.5 0 0.1 0.1 0.1 0 0 0.5 0.25 0.25 0.25 -->
 57            < ROUTE  fromNode='CalculateColorSchemeMEDAL' fromField='heightValuesOutput' toNode='BathymetryGrid' toField='set_height'/>
 58            < ROUTE  fromNode='CalculateColorSchemeMEDAL' fromField='colorValuesOutput' toNode='BathymetryGridColorNodeCalculated' toField='set_color'/>
 59       </Scene>
 60  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: BathymetryGrid, BathymetryGridColorNodeCalculated, CalculateColorSchemeMEDAL, CoordinateAxes, GridXZ_20x20Fixed

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, Background, Color, DirectionalLight, ElevationGrid, field, Group, head, Inline, Material, meta, NavigationInfo, ROUTE, Scene, Script, Shape, Switch, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 2 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

CalculateColorSchemeMEDAL
Script
heightValuesOutput
MFFloat

ROUTE
event to
(1)
BathymetryGrid
ElevationGrid
set_height
MFFloat
CalculateColorSchemeMEDAL
Script
colorValuesOutput
MFColor

ROUTE
event to
(1)
BathymetryGridColorNodeCalculated
Color
set_color
MFColor

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribedIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribed.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->