<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "http://www.web3d.org/specifications/x3d-3.2.dtd">
<X3D profile='Immersive' version='3.2 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.2.xsd '>
<head>
<meta name='titlecontent='Butakov.x3d'/>
<meta name='descriptioncontent='Brazilian Naval Academy Training Ship making a manoverboard manouver'/>
<meta name='creatorcontent='Claudio Coreixas'/>
<meta name='createdcontent='20 October 2009'/>
<meta name='modifiedcontent='14 January 2014'/>
<meta name='referencecontent=' http://www.en.mar.mil.br '/>
<meta name='subjectcontent='ships manouvering'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/ShipsMilitary/PatrolCraft-NavalAcademy-Brazil/Butakov.x3d '/>
<meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<Sound maxBack='100maxFront='100'>
<AudioClip DEF='boatdescription='ambient soundloop='true'
  url=' "boatSound.wav" "https://savage.nps.edu/Savage/ShipsMilitary/PatrolCraft-NavalAcademy-Brazil/boatSound.wav" '/>
</Sound>
<NavigationInfo type='"EXAMINE"'/>
<WorldInfo info='"an Butakov MOB scene"title='Butakov'/>
<Background skyAngle='0.7 0skyColor='0.478431 0.160784 1 0.701961 0.776471 1 0.380392 0.384314 1'/>
<Viewpoint description='toporientation='1 0 0 -1.57position='1.8 10 1.4'/>
<!-- ROUTE information for MovementTimer node:  [from ControlScript.speed to cycleInterval ] [from acceleratorSensor.touchTime to pauseTime ] [from acceleratorSensor.touchTime to pauseTime ] [from ControlScript.startTimeReset to resumeTime ] [from fraction_changed to MovetheShip.set_fraction ] [from fraction_changed to SpinTheShip.set_fraction ] [from fraction_changed to SpinTheShip2.set_fraction ] -->
<TimeSensor DEF='MovementTimercycleInterval='20loop='true'/>
<!-- ROUTE information for spintTimer node:  [from fraction_changed to SpinTheShip3.set_fraction ] -->
<TimeSensor DEF='spintTimercycleInterval='4loop='true'/>
<!-- ROUTE information for MovetheShip node:  [from MovementTimer.fraction_changed to set_fraction ] [from value_changed to Ship3.translation ] -->
<PositionInterpolator DEF='MovetheShipkey='0.025 0.05 0.075 0.1 0.125 0.15 0.175 0.2 0.225 0.25 0.275 0.3 0.325 0.35 0.375 0.4 0.425 0.45 0.475 0.5 0.525 0.55 0.575 0.6 0.625 0.65 0.675 0.7 0.725 0.75 0.775 0.8 0.825 0.85 0.875 0.9 0.925 0.95 0.975 1keyValue='-3 0 0 -2.5 0 0 -2 0 0 -1.5 0 0 -1 0 0 -0.5 0 0 0 0 0 0.48 0 0.1 0.95 0 0.28 1.35 0 0.55 1.65 0 0.95 1.88 0 1.4 1.96 0 1.9 2.05 0 2.45 2.25 0 2.9 2.5 0 3.3 2.9 0 3.68 3.3 0 3.9 3.8 0 4 4.3 0 4 4.8 0 3.9 5.2 0 3.65 5.6 0 3.3 5.85 0 2.9 6.02 0 2.4 6.08 0 1.9 5.95 0 1.4 5.78 0 0.95 5.42 0 0.55 5 0 0.25 4.55 0 0.05 4 0 0 3.5 0 0 3 0 0 2.5 0 0 2 0 0 1.5 0 0 1 0 0 0.5 0 0 0 0 0'/>
<ROUTE fromNode='MovementTimerfromField='fraction_changedtoNode='MovetheShiptoField='set_fraction'/>
<!-- ROUTE information for SpinTheShip node:  [from MovementTimer.fraction_changed to set_fraction ] [from value_changed to Ship.rotation ] -->
<OrientationInterpolator DEF='SpinTheShipkey='0 0.083333 0.166667 0.25 0.333333 0.416667 0.5 0.583333 0.666667 0.75 0.833333 0.916667 1keyValue='1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 -0.25 1 0 0 0 1 0 0 0.25 1 0 0 0.3 1 0 0 0.35 1 0 0 0.3 1 0 0 0.25 1 0 0 0 1 1 0 0 1 1 0 0'/>
<ROUTE fromNode='MovementTimerfromField='fraction_changedtoNode='SpinTheShiptoField='set_fraction'/>
<!-- ROUTE information for SpinTheShip2 node:  [from MovementTimer.fraction_changed to set_fraction ] [from value_changed to Ship2.rotation ] -->
<OrientationInterpolator DEF='SpinTheShip2key='0 0.166667 0.333333 0.5 0.666667 0.833333 1keyValue='0 1 0 0 0 1 0 0 0 1 0 -1.57 0 1 0 0 0 1 0 1.57 0 1 0 3.14 0 1 0 3.14'/>
<ROUTE fromNode='MovementTimerfromField='fraction_changedtoNode='SpinTheShip2toField='set_fraction'/>
<!-- ROUTE information for SpinTheShip3 node:  [from spintTimer.fraction_changed to set_fraction ] [from value_changed to Ship4.rotation ] -->
<OrientationInterpolator DEF='SpinTheShip3key='0 0.5 1keyValue='0 0 1 -0.05 0 0 1 0.05 0 0 1 -0.05'/>
<ROUTE fromNode='spintTimerfromField='fraction_changedtoNode='SpinTheShip3toField='set_fraction'/>
<!-- ROUTE information for Ship3 node:  [from MovetheShip.value_changed to translation ] -->
<Transform DEF='Ship3'>
<ROUTE fromNode='MovetheShipfromField='value_changedtoNode='Ship3toField='translation'/>
<Viewpoint description='topMovingorientation='1 0 0 -1.57079position='0 3 0'/>
<!-- ROUTE information for Ship2 node:  [from SpinTheShip2.value_changed to rotation ] -->
<Transform DEF='Ship2'>
<ROUTE fromNode='SpinTheShip2fromField='value_changedtoNode='Ship2toField='rotation'/>
<Viewpoint description='Sternorientation='0 1 0 -1.57position='-3 0.5 0'/>
<Viewpoint description='boworientation='0 1 0 1.57position='3 0.5 0'/>
<Viewpoint description='bow Closeorientation='0 1 0 1.57position='1 0.3 0'/>
<Viewpoint description='stb Boworientation='-0.3162 0.9487 0 0.8117position='1 0.5 1'/>
<Viewpoint description='stb Bridge Outsideorientation='0 0.6247 0 0.8179position='0.5 0.2 0.6'/>
<Viewpoint description='port Boworientation='0 0.9487 0 2.3299position='1.5 0.5 -1.5'/>
<Viewpoint description='stb Quarterorientation='-0.3162 -0.9487 0 0.8117position='-1.5 0.25 1.5'/>
<Viewpoint description='port Quarterorientation='0 -0.9487 0 2.3299position='-1.5 0.25 -1.5'/>
<!-- ROUTE information for Ship node:  [from SpinTheShip.value_changed to rotation ] -->
<Transform DEF='Ship'>
<ROUTE fromNode='SpinTheShipfromField='value_changedtoNode='ShiptoField='rotation'/>
<Viewpoint description='StbRudderorientation='0 1 0 -1.57position='-0.9 -0.1 0.14'/>
<!-- ROUTE information for Ship4 node:  [from SpinTheShip3.value_changed to rotation ] -->
<Transform DEF='Ship4'>
<Viewpoint description='.50calorientation='0 1 0 1.57position='-0.05 0.28 0'/>
<Viewpoint description='BridgefieldOfView='0.43orientation='0 -0.9935 0 1.57079position='0.14 0.27 0'/>
<Viewpoint description='RadarfieldOfView='0.45orientation='-0.1888 -0.982 0 1.57079position='-0.6 0.5 0'/>
<ROUTE fromNode='SpinTheShip3fromField='value_changedtoNode='Ship4toField='rotation'/>
<Transform scale='0.15 0.15 0.15'> </Transform>
</Transform>
</Transform>
</Transform>
</Transform>
<Transform translation='0 -5 0'>
<Shape DEF='ocean'>
<Appearance>
<Material ambientIntensity='1diffuseColor='0 0.219608 0.419608shininess='1transparency='0.16'/>
</Appearance>
<Box size='200 10 100solid='false'/>
</Shape>
</Transform>
<Transform>
<Shape DEF='path'>
<Extrusion crossSection='0 0 0.01 0 0 -0.01 0 0.01 -0.01 0 0.01 0.01 0 0spine='-3 0 0 -2.5 0 0 -2 0 0 -1.5 0 0 -1 0 0 -0.5 0 0 0 0 0 0.48 0 0.1 0.95 0 0.28 1.35 0 0.55 1.65 0 0.95 1.88 0 1.4 1.96 0 1.9 2.05 0 2.45 2.25 0 2.9 2.5 0 3.3 2.9 0 3.68 3.3 0 3.9 3.8 0 4 4.3 0 4 4.8 0 3.9 5.2 0 3.65 5.6 0 3.3 5.85 0 2.9 6.02 0 2.4 6.08 0 1.9 5.95 0 1.4 5.78 0 0.95 5.42 0 0.55 5 0 0.25 4.55 0 0.05 4 0 0 3.5 0 0 3 0 0 2.5 0 0 2 0 0 1.5 0 0 1 0 0 0.5 0 0 0 0 0 -0.5 0 0'/>
<Appearance>
<Material ambientIntensity='1diffuseColor='0.858824 0.568627 0shininess='0.56transparency='0.36'/>
</Appearance>
</Shape>
</Transform>
<Transform translation='1 0 1'>
<Shape DEF='accel'>
<Box size='0.1 0.1 0.1'/>
<Appearance>
<Material ambientIntensity='1diffuseColor='1 1 0.980392shininess='0.56transparency='0.36'/>
</Appearance>
</Shape>
<!-- ROUTE information for acceleratorSensor node:  [from isActive to ControlScript.buttonMotionDone ] [from touchTime to MovementTimer.pauseTime ] [from touchTime to ControlScript.buttonPushTime ] [from touchTime to MovementTimer.pauseTime ] -->
<TouchSensor DEF='acceleratorSensordescription='Touch to change ships speed'/>
</Transform>
<!-- ROUTE information for ControlScript node:  [from acceleratorSensor.isActive to buttonMotionDone ] [from acceleratorSensor.touchTime to buttonPushTime ] [from speed to MovementTimer.cycleInterval ] [from startTimeReset to MovementTimer.resumeTime ] -->
<Script DEF='ControlScript'>
<field name='buttonMotionDonetype='SFBoolaccessType='inputOnly'/>
<field name='buttonPushCounttype='SFInt32value='0accessType='initializeOnly'/>
<field name='speedtype='SFTimeaccessType='outputOnly'/>
<field name='buttonPushTimetype='SFTimeaccessType='inputOnly'/>
<field name='startTimeResettype='SFTimeaccessType='outputOnly'/>
<![CDATA[
      
ecmascript:
// Filename:    acceleratorScript.js
// Author:      Claudio Coreixas
// Created:     7 October 2009


function buttonMotionDone (value)
{
    if (value == false)
    {
        buttonPushCount ++;
        if (buttonPushCount > 3)
        {
            buttonPushCount = 0;
        }

        if (buttonPushCount == 0)
        {

	     speed = new SFTime (20);
        }
        else if (buttonPushCount == 1)
        {

		speed = new SFTime (10);
        }
        else if (buttonPushCount == 2)
        {

		speed = new SFTime (20);
        }
        else if (buttonPushCount == 3)
        {

		speed = new SFTime (10);
        }
        startTimeReset = new SFTime (buttonPushTime + 5);

    }
}

    
]]>
</Script>
<ROUTE fromNode='acceleratorSensorfromField='isActivetoNode='ControlScripttoField='buttonMotionDone'/>
<ROUTE fromNode='ControlScriptfromField='speedtoNode='MovementTimertoField='cycleInterval'/>
<ROUTE fromNode='acceleratorSensorfromField='touchTimetoNode='MovementTimertoField='pauseTime'/>
<ROUTE fromNode='acceleratorSensorfromField='touchTimetoNode='ControlScripttoField='buttonPushTime'/>
<ROUTE fromNode='acceleratorSensorfromField='touchTimetoNode='MovementTimertoField='pauseTime'/>
<ROUTE fromNode='ControlScriptfromField='startTimeResettoNode='MovementTimertoField='resumeTime'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : accel, acceleratorSensor, boat, ControlScript, MovementTimer, MovetheShip, ocean, path, Ship, Ship2, Ship3, Ship4, SpinTheShip, SpinTheShip2, SpinTheShip3, spintTimer

Index for Viewpoint images : Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4, Viewpoint_5, Viewpoint_6, Viewpoint_7, Viewpoint_8, Viewpoint_9, Viewpoint_10, Viewpoint_11, Viewpoint_12, Viewpoint_13, Viewpoint_14
-->

<!-- 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)
-->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->