<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<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 '>
<head>
<meta name='titlecontent='BlueAngelF18Example.x3d'/>
<meta name='descriptioncontent='The BlueAngelF18 example model integrated with ExternPrototypes - clicking any axle starts animation, such as, raising or lowering landing gears simultaneously. Clicking cockpit canopy makes it open or close.'/>
<meta name='creatorcontent='Etsuko Lippi'/>
<meta name='createdcontent='18 October 2001'/>
<meta name='modifiedcontent='28 November 2019'/>
<meta name='Imagecontent='blueangels.jpg'/>
<meta name='Imagecontent=' https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/blueangels.jpg '/>
<meta name='referencecontent=' http://www.navy.com/blueangels '/>
<meta name='referencecontent=' http://www.BlueAngels.navy.mil '/>
<meta name='referencecontent=' http://www.fas.org/man/dod-101/sys/ac/f-18.htm '/>
<meta name='referencecontent=' http://www.BlueAngels.org '/>
<meta name='referencecontent=' http://www.chinfo.navy.mil/navpalib/aircraft/b-angels/blues.html '/>
<meta name='referencecontent=' http://www.danshistory.com/fa18.html '/>
<meta name='referencecontent=' http://www.csd.uwo.ca/~pettypi/elevon/baugher_us/f018.html '/>
<meta name='referencecontent=' https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels.jpg '/>
<meta name='referencecontent=' https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels_bottom.jpg '/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.x3d '/>
<meta name='subjectcontent='Aircraft, F18, Blue Angel example'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<ExternProtoDeclare name='ViewPositionOrientationappinfo='ViewPositionOrientation provides provides console output of local position and orientation as user navigates'
  url=' "../../Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" '>
<field name='enabledtype='SFBoolaccessType='inputOutput'
 appinfo='Whether or not ViewPositionOrientation sends output to console.'/>

<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'
 appinfo='Output internal trace messages for debugging this node - developer use only can be ignored.'/>

<field name='set_traceEnabledtype='SFBoolaccessType='inputOnly'
 appinfo='Ability to turn output tracing on/off at runtime.'/>

<field name='position_changedtype='SFVec3faccessType='outputOnly'
 appinfo='Output local position.'/>

<field name='orientation_changedtype='SFRotationaccessType='outputOnly'
 appinfo='Output local orientation.'/>

<field name='outputViewpointStringtype='MFStringaccessType='outputOnly'
 appinfo='MFString value of new Viewpoint'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='WheelsRearRight'
  url=' "WheelsRearRightPrototype.x3d#WheelsRearRight" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.x3d#WheelsRearRight" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.x3d#WheelsRearRight" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.wrl#WheelsRearRight" "WheelsRearRightPrototype.wrl#WheelsRearRight" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.wrl#WheelsRearRight" '>
<field name='gearuptype='SFBoolaccessType='inputOnly'
 appinfo='boolean eventIn: true = wheels up false = wheels down.'/>

<field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
<field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='WheelsRearLeft'
  url=' "WheelsRearLeftPrototype.x3d#WheelsRearLeft" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.x3d#WheelsRearLeft" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.x3d#WheelsRearLeft" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.wrl#WheelsRearLeft" "WheelsRearLeftPrototype.wrl#WheelsRearLeft" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.wrl#WheelsRearLeft" '>
<field name='gearuptype='SFBoolaccessType='inputOnly'
 appinfo='boolean eventIn: true = wheels up false = wheels down.'/>

<field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
<field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='WheelsFront'
  url=' "WheelsFrontPrototype.x3d#WheelsFront" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront" "WheelsFrontPrototype.wrl#WheelsFront" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront" '>
<field name='gearuptype='SFBoolaccessType='inputOnly'
 appinfo='boolean eventIn: true = wheels up false = wheels down.'/>

<field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
<field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='Canopy'
  url=' "CanopyPrototype.x3d#Canopy" "../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy" "../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy" "CanopyPrototype.wrl#Canopy" "https://savage.nps.edu/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy" '>
<field name='canopyOpentype='SFBoolaccessType='inputOnly'
 appinfo='boolean eventIn: true = canopy open false = canopy close.'/>

<field name='canopyOuttype='SFBoolaccessType='outputOnly'/>
<field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
</ExternProtoDeclare>
<NavigationInfo speed='2'/>
<Background groundAngle='1.309 1.5702groundColor='0.5 0.3 0.3 0.5 0.3 0.3 0.5 0.4 0.4skyAngle='1.309 1.572skyColor='0 0.2 0.7 0 0.5 1 1 1 1'/>
<ProtoInstance name='ViewPositionOrientation'>
<fieldValue name='enabledvalue='true'/>
</ProtoInstance>
<Viewpoint description='Blue Angel Default Viewposition='1.9 -.8 7.6'/>
<Viewpoint description='Blue Angel View From Aboveorientation='-.952 -.264 -.152 1.4741position='.3 12.4 -4.8'/>
<Viewpoint description='Blue Angel View From Bottomorientation='.513 -.797 .319 1.3342position='-7.1 -8.8 -2'/>
<Viewpoint description='Blue Angel Front Vieworientation='0.048 .998 0.049 4.6832position='-7.2 .2 -5'/>
<Viewpoint description='Blue Angel Back Vieworientation='-.152 .981 .116 1.3177position='13.4 2.1 -2.1'/>
<Viewpoint description='Blue Angel Side Vieworientation='-.733 .678 0.065 .3177position='3.7 1.6 4.3'/>
<Viewpoint description='Cockpit Inside Pilot Vieworientation='0 1 0 1.5636position='-.8 .6 -5'/>
<LOD range='200 600 1000'>
<Group DEF='Viewpoints'>
<!-- High Resolution -->
<Group DEF='High'>
<Group DEF='LODHigh'>
<Transform rotation='0 1 0 1.57translation='3.595 0.1 -0.8'>
<!-- ROUTE information for CP node:  [from CanopyTouchSensor.touchTime to animationStartTime ] [from CanopyExampleSelectionScript.status to canopyOpen ] -->
<ProtoInstance name='CanopyDEF='CP'>
<fieldValue name='traceEnabledvalue='true'/>
</ProtoInstance>
<!-- ROUTE information for CanopyTouchSensor node:  [from touchTime to CP.animationStartTime ] [from isActive to CanopyExampleSelectionScript.enabled ] -->
<TouchSensor DEF='CanopyTouchSensordescription='canopy open/close'/>
</Transform>
<Transform rotation='0 1 -0 3.14translation='5.7 -0.2 -5'> </Transform>
<Transform rotation='-0.69 0.70 0.19 2.78scale='1.5 1.5 1.5translation='5.3 -0.46 -4.3'> </Transform>
<Transform rotation='-0.69 0.70 -0.19 3.51scale='1.5 1.5 1.5translation='5.3 -0.46 -5.7'>
<Inline USE='TwinVerticalTails'/>
<!-- X = -210, Y = 0, Z = 91 -->
</Transform>
<Transform> </Transform>
<Transform rotation='0 0 -1 0.07translation='-3.0 0.39 -5'> </Transform>
<Transform rotation='0 0 1 3.14scale='0.7 0.7 0.5translation='-1 -0.1 -2.5'> </Transform>
</Group>
<Group DEF='LODHigh2'>
<Transform scale='0.25 0.25 0.25translation='-1.0 0.1 -5'> </Transform>
<Transform scale='0.35 0.35 0.35translation='-0.5 -1.25 -5.26'>
<!-- ROUTE information for WP node:  [from GearUpDownTouchSensor.touchTime to animationStartTime ] [from ExampleSelectionScript.status to gearup ] -->
<ProtoInstance name='WheelsFrontDEF='WP'>
<fieldValue name='traceEnabledvalue='true'/>
</ProtoInstance>
</Transform>
<!-- ROUTE information for GearUpDownTouchSensor node:  [from touchTime to WP.animationStartTime ] [from touchTime to WPRight.animationStartTime ] [from touchTime to WPLeft.animationStartTime ] [from isActive to ExampleSelectionScript.enabled ] -->
<TouchSensor DEF='GearUpDownTouchSensordescription='landing gear up/down'/>
<Transform scale='0.35 0.35 0.35translation='3.5 -1.2 -6.5'>
<!-- ROUTE information for WPLeft node:  [from GearUpDownTouchSensor.touchTime to animationStartTime ] [from ExampleSelectionScript.status to gearup ] -->
<ProtoInstance name='WheelsRearLeftDEF='WPLeft'>
<fieldValue name='traceEnabledvalue='true'/>
</ProtoInstance>
</Transform>
<Transform rotation='0 1 0 3.14scale='0.35 0.35 0.35translation='3.5 -1.215 -3.5'>
<!-- ROUTE information for WPRight node:  [from GearUpDownTouchSensor.touchTime to animationStartTime ] [from ExampleSelectionScript.status to gearup ] -->
<ProtoInstance name='WheelsRearRightDEF='WPRight'>
<fieldValue name='traceEnabledvalue='true'/>
</ProtoInstance>
</Transform>
<Transform rotation='0 0 -1 0.09scale='0.85 0.85 0.85translation='0.8 0.15 -1.15'> </Transform>
<Group DEF='Animation'>
<Transform DEF='GearUPDown'>
<!-- ROUTE information for ExampleSelectionScript node:  [from GearUpDownTouchSensor.isActive to enabled ] [from status to WP.gearup ] [from status to WPRight.gearup ] [from status to WPLeft.gearup ] -->
<Script DEF='ExampleSelectionScript'>
<field name='landedtype='SFInt32value='-1accessType='initializeOnly'/>
<field name='enabledtype='SFBoolaccessType='inputOnly'/>
<field name='statustype='SFBoolaccessType='outputOnly'/>
<![CDATA[
                  
ecmascript:


function tracePrint (outputString)
{
	var traceEnabled = false;
	if (traceEnabled) Browser.print ('[trace] ' + outputString);
}

function enabled(value, timeStamp) {

	tracePrint('enabled = ' + value);
	if (value == true)
	{
		if (landed == -1)
		{			
                        status = false;
                        landed = 0;			
		}
                
		if (landed == 0)
		{
			if (status)
			{
				status = false;                                
			}
			else
			{
				status = true;                                				
			}
		}

                else
                {
         		landed = 0;
     			return;
                }
	}
	//print ('status = ' + status);
}

                
]]>
</Script>
</Transform>
<Transform DEF='Canopy'>
<!-- ROUTE information for CanopyExampleSelectionScript node:  [from CanopyTouchSensor.isActive to enabled ] [from status to CP.canopyOpen ] -->
<Script DEF='CanopyExampleSelectionScript'>
<field name='landedtype='SFInt32value='-1accessType='initializeOnly'/>
<field name='enabledtype='SFBoolaccessType='inputOnly'/>
<field name='statustype='SFBoolaccessType='outputOnly'/>
<![CDATA[
                  
ecmascript:


function tracePrint (outputString)
{
	var traceEnabled = false;
	if (traceEnabled) Browser.print ('[trace] ' + outputString);
}

function enabled(value, timeStamp) {

	tracePrint('enabled = ' + value);
	if (value == true)
	{
		if (landed == -1)
		{			
                        status = false;
                        landed = 0;			
		}
                
		if (landed == 0)
		{
			if (status)
			{
				status = false;                                
			}
			else
			{
				status = true;                               				
			}
		}

                else
                {
         		landed = 0;
     			return;
                }
	}
	//print ('status = ' + status);
}

                
]]>
</Script>
</Transform>
<!-- GearUpDown Animation -->
<ROUTE fromNode='GearUpDownTouchSensorfromField='touchTimetoNode='WPtoField='animationStartTime'/>
<ROUTE fromNode='GearUpDownTouchSensorfromField='touchTimetoNode='WPRighttoField='animationStartTime'/>
<ROUTE fromNode='GearUpDownTouchSensorfromField='touchTimetoNode='WPLefttoField='animationStartTime'/>
<ROUTE fromNode='GearUpDownTouchSensorfromField='isActivetoNode='ExampleSelectionScripttoField='enabled'/>
<ROUTE fromNode='ExampleSelectionScriptfromField='statustoNode='WPtoField='gearup'/>
<ROUTE fromNode='ExampleSelectionScriptfromField='statustoNode='WPRighttoField='gearup'/>
<ROUTE fromNode='ExampleSelectionScriptfromField='statustoNode='WPLefttoField='gearup'/>
<!-- Canopy Animation -->
<ROUTE fromNode='CanopyTouchSensorfromField='touchTimetoNode='CPtoField='animationStartTime'/>
<ROUTE fromNode='CanopyTouchSensorfromField='isActivetoNode='CanopyExampleSelectionScripttoField='enabled'/>
<ROUTE fromNode='CanopyExampleSelectionScriptfromField='statustoNode='CPtoField='canopyOpen'/>
</Group>
</Group>
<Group DEF='LODLow'> </Group>
</Group>
</Group>
<!-- Medium Resolution -->
<Group DEF='Medium'>
<Group USE='LODHigh'/>
<Group DEF='LODMedium'>
<Transform scale='0.35 0.35 0.35translation='-0.5 -1.25 -5.26'> </Transform>
<Transform scale='0.35 0.35 0.35translation='3.5 -1.2 -6.5'> </Transform>
<Transform rotation='0 1 0 3.14scale='0.35 0.35 0.35translation='3.5 -1.2 -3.5'> </Transform>
<Transform rotation='0 0 -1 0.09scale='0.85 0.85 0.85translation='0.8 0.15 -1.15'> </Transform>
</Group>
<Group USE='LODLow'/>
</Group>
<!-- Low Resolution -->
<Group DEF='Low'>
<Group USE='LODHigh'/>
<Group USE='LODMedium'/>
<Transform rotation='0 1 0 3.14scale='1.1 1.1 1.1translation='1.4 0 -5'> </Transform>
</Group>
<WorldInfo info='"null node"'/>
</LOD>
</Scene>
</X3D>
<!--

Index for ExternProtoDeclare definitions : Canopy, ViewPositionOrientation, WheelsFront, WheelsRearLeft, WheelsRearRight

Index for DEF nodes : Animation, Canopy, CanopyExampleSelectionScript, CanopyTouchSensor, CP, ExampleSelectionScript, GearUPDown, GearUpDownTouchSensor, High, LODHigh, LODHigh2, LODLow, LODMedium, Low, Medium, TwinVerticalTails, Viewpoints, WP, WPLeft, WPRight

Index for Viewpoint images : Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4, Viewpoint_5, Viewpoint_6, Viewpoint_7
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

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