#X3D V3.0 utf8 PROFILE Immersive # [X3D] version=3.0 # [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.0.xsd # X3D-to-ClassicVRML XSL translation autogenerated by X3dToClassicVrmlEncoding.xslt and X3dToVrml97.xslt # https://www.web3d.org/x3d/content/X3dToClassicVrmlEncoding.xslt # https://www.web3d.org/x3d/content/X3dToVrml97.xslt # Transformation using XSLT processor: Saxonica # head META "title" "M198Howitzer.x3d" META "description" "M198 Howitzer to scale" META "creator" "J.P. McDonough" META "created" "7 January 2004" META "modified" "28 November 2019" META "reference" "M198-dvic502.jpg" META "reference" "Impact.avi" META "reference" "http://www.army.mil/fact_files_site/m198" META "reference" "https://www.fas.org/man/dod-101/sys/land/m198.htm" META "identifier" "https://savage.nps.edu/Savage/Weapons/Guns/M198Howitzer.x3d" META "generator" "X3D-Edit, https://savage.nps.edu/X3D-Edit" META "license" "../../license.html" # [Scene] ========== ========== ========== WorldInfo { title "M198Howitzer.x3d" } EXTERNPROTO ViewPositionOrientation [ # [appinfo] ViewPositionOrientation provides provides console output of local position and orientation as user navigates inputOutput SFBool enabled # [appinfo] Whether or not ViewPositionOrientation sends output to console. initializeOnly SFBool traceEnabled # [appinfo] Output internal trace messages for debugging this node - developer use only can be ignored. inputOnly SFBool set_traceEnabled # [appinfo] Ability to turn output tracing on/off at runtime. outputOnly SFVec3f position_changed # [appinfo] Output local position. outputOnly SFRotation orientation_changed # [appinfo] Output local orientation. outputOnly MFString outputViewpointString # [appinfo] MFString value of new Viewpoint ][ "../../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" ] DEF ExampleViewPositionOrientation ViewPositionOrientation { enabled FALSE } Sound { maxBack 100 maxFront 100 minBack 0.01 minFront 0.01 source DEF CannonFireSound AudioClip { description "Cannon fire sound" url [ "../../GroundVehicles/T72M/CannonFire.wav" "https://savage.nps.edu/Savage/GroundVehicles/T72M/CannonFire.wav" ] } } DEF betweenTrails Viewpoint { description "between Trails" orientation -1 0 0 0 position 0 1.4 10 } DEF sideViewClose Viewpoint { description "Side View Close" orientation 0.007 0.997 0.076 1.7635 position 9.8 2.2 -1.8 } DEF sideView Viewpoint { description "from Side" orientation 0 1 0 1.57 position 320 10 -160 } DEF underTube Viewpoint { description "under Tube" orientation -0.02 -0.982 -0.19 3.1266 position 0 5.7 -7.4 } DEF downBarrel Viewpoint { description "down Barrel" orientation 0.012 -0.925 -0.381 3.138 position -0.1 7.6 -6.7 } # Roughly to scale. DEF M198_Howitzer Group { children [ DEF LowerCar Group { children [ Shape { geometry DEF LowerCarriage1 Cylinder { height .5 } appearance DEF camiPaint Appearance { material DEF cami Material { ambientIntensity 0.25 diffuseColor 0.054 0.233 0.39 shininess 0 } texture DEF camo ImageTexture { repeatS FALSE repeatT FALSE url [ "greenCamo.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/greenCamo.jpg" ] } } } DEF rightTrailMover Transform { translation .1 0 0 children [ DEF RightTrail Transform { rotation 0 1 0 -1.1 translation 0 -.3 0 children [ DEF brakeResevoir Transform { rotation 0 1 0 1.57 translation 2 .27 0 children [ Transform { rotation 1 0 0 1.57 scale 1.6 1 1.2 children [ Shape { geometry Cylinder { height 1.2 radius .15 } appearance USE camiPaint } ] } ] } DEF basePlateClamp Transform { rotation 0 1 0 1.7 scale .05 .05 .05 translation 2.7 .6 -.2 children [ DEF clamp Shape { geometry Extrusion { crossSection [ 0 0 1 0 1 2 3 2 3 3 0 3 0 0 ] solid FALSE spine [ 0 0 0 2 0 0 ] } appearance USE camiPaint } ] } Transform { rotation 0 1 0 -1.7 scale .05 .05 .05 translation 1.7 .6 -.2 children [ USE clamp ] } Transform { rotation 1 0 0 -1.57 children [ Transform { scale .22 .3 .19 children [ DEF trail Shape { geometry Extrusion { crossSection [ 0 0 0 3 16 2.2 20 1 20 -1 18.5 -1 18 0 0 0 ] spine [ 0 0 0 0 1.5 0 ] } appearance USE camiPaint } ] } ] } ] } DEF RightSpade Transform { rotation 0 1 0 .5 scale .07 .1 .1 translation 2.9 -0.45 3.45 children [ Transform { rotation 0 1 0 3.14 children [ Transform { rotation 1 0 0 -1.57 children [ DEF spade Shape { appearance USE camiPaint geometry Extrusion { crossSection [ 0 0 5 0 4 -5 4 -4 3.85 -3.5 3.75 -3 3.5 -2 3 -1 0 -.5 0 0 ] spine [ 0 0 0 20 0 0 ] } } ] } ] } ] } DEF trailSpreader CylinderSensor { description "Used to spread the trails" maxAngle 0 minAngle -.5 } ] ROUTE trailSpreader.rotation_changed TO rightTrailMover.set_rotation } DEF leftTrailMover Transform { translation -.1 0 0 children [ DEF leftTrail Transform { rotation 0 1 0 -2.1 translation -.5 -.3 -.25 children [ DEF lbasePlateClamp Transform { rotation 0 1 0 1.7 scale .05 .05 .05 translation 2.7 .6 -.2 children [ USE clamp ] } Transform { rotation 0 1 0 -1.7 scale .05 .05 .05 translation 1.7 .6 -.2 children [ USE clamp ] } Transform { rotation 1 0 0 -1.57 children [ Transform { scale .22 .3 .19 children [ USE trail ] } ] } ] } DEF leftSpade Transform { rotation 0 1 0 -.523 scale .07 .1 .1 translation -1.9 -0.45 3.9 children [ Transform { center .5 0 .5 rotation 0 1 0 3.14 children [ Transform { rotation 1 0 0 -1.57 children [ USE spade ] } ] } ] } DEF lTrailSpreader CylinderSensor { description "Used to spread the trails" maxAngle .5 } ] ROUTE lTrailSpreader.rotation_changed TO leftTrailMover.set_rotation } Transform { translation 0 -.25 -.75 children [ DEF basePlate Shape { geometry Cone { bottomRadius .75 height .25 } appearance USE camiPaint } ] } DEF wheelRaiser Group { children [ DEF AnimationTransform Transform { rotation 1 0 0 .1 children [ DEF ButtonChoice Switch { whichChoice 0 children [ ### children3 Group { children [ Transform { scale 4 1 1 translation 0 -.3 -.3 children [ DEF ClearSphere Shape { appearance Appearance { material DEF Transparent Material { emissiveColor 1 1 1 transparency 1.0 } } geometry Sphere { radius .5 } } ] } DEF ClearSphere1 TouchSensor { description "used to raise and lower the wheels" } DEF wheelUp OrientationInterpolator { key [ 0 .25 .5 .75 .85 1 ] keyValue [ 1 0 0 0 1 0 0 .5 1 0 0 .75 1 0 0 1.25 1 0 0 1.7 1 0 0 2 ] } DEF MoveBoxUp PositionInterpolator { key [ 0 .5 1 ] keyValue [ 0 -3 0 0 0 0 0 3 0 ] } ### Warning: no ROUTE found for PositionInterpolator input ### Warning: no ROUTE found for PositionInterpolator output DEF BoxUpTimer TimeSensor { cycleInterval 3 } ] ROUTE BoxUpTimer.fraction_changed TO wheelUp.set_fraction ROUTE wheelUp.value_changed TO AnimationTransform.set_rotation ROUTE ClearSphere1.touchTime TO BoxUpTimer.startTime } Group { children [ Transform { scale 4 1 1 translation 0 -.3 -.3 children [ USE ClearSphere ] } DEF ClearSphere2 TouchSensor { description "used to raise and lower the wheels" } DEF wheelDown OrientationInterpolator { key [ 0 .25 .5 .75 .85 1 ] keyValue [ 1 0 0 2 1 0 0 1.7 1 0 0 1.25 1 0 0 .75 1 0 0 .5 1 0 0 0 ] } DEF MoveBoxDown PositionInterpolator { key [ 0 0.5 1 ] keyValue [ 0 3 0 0 0 0 0 -3 0 ] } ### Warning: no ROUTE found for PositionInterpolator input ### Warning: no ROUTE found for PositionInterpolator output DEF BoxDownTimer TimeSensor { cycleInterval 3 } ] ROUTE BoxDownTimer.fraction_changed TO wheelDown.set_fraction ROUTE wheelDown.value_changed TO AnimationTransform.set_rotation ROUTE ClearSphere2.touchTime TO BoxDownTimer.startTime } ] } DEF rightWheel Group { children [ DEF rightWheel1 Transform { translation .2 -.8 -.3 children [ DEF rightTire Transform { rotation 0 0 1 -1.57 translation 1.0 .4 0 children [ DEF tire Shape { geometry Cylinder { height .2 radius .4 } appearance Appearance { material DEF black Material { diffuseColor 0.1 0.1 0.1 shininess 0 } } } ] } DEF rightRim Transform { rotation 0 0 1 -1.57 translation 1.0 .4 0 children [ DEF rim Shape { geometry Cylinder { height .22 radius .25 } appearance USE camiPaint } ] } ] } Transform { rotation 1 0 0 -1.75 children [ DEF rWheelLift Transform { rotation 0 1 0 1.57 scale .25 .25 .25 translation 1 0 0 children [ Transform { children [ Shape { geometry Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] spine [ 0 0 0 0 0 .3 ] } appearance USE camiPaint } ] } Transform { translation 1.5 1.5 .45 children [ Shape { geometry Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] spine [ 0 0 0 0 0 .3 ] } appearance USE camiPaint } ] } Transform { rotation 0 0 1 1 translation 1 1 0.3 children [ Shape { geometry Box { size 2 1 .3 } appearance USE camiPaint } ] } ] } ] } ] } DEF leftWheel Group { children [ DEF leftWheel1 Transform { translation -1.2 -.35 -.35 children [ DEF leftTire Transform { rotation 0 0 1 -1.57 children [ USE tire ] } DEF leftRim Transform { rotation 0 0 1 -1.57 children [ USE rim ] } ] } DEF wheelSensor TouchSensor { description "Point at box to spin it" } DEF CLOCK TimeSensor { cycleInterval 4 enabled FALSE loop TRUE } DEF wheelInterpolator OrientationInterpolator { key [ 0.0 0.25 0.50 0.75 1.0 ] keyValue [ 1 0.0 0 -1.57 1 0.0 0 0 1 0.0 0 1.57 1 0 0 3.14 1 0 0 -1.57 ] } Transform { rotation 1 0 0 -3.1 children [ DEF wheelLift Transform { rotation 0 1 0 -1.57 scale .25 .25 .25 translation -1 0 0 children [ Transform { children [ Shape { geometry Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] spine [ 0 0 0 0 0 .3 ] } appearance USE camiPaint } ] } Transform { translation 1.5 1.5 .45 children [ Shape { geometry Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] spine [ 0 0 0 0 0 .3 ] } appearance USE camiPaint } ] } Transform { rotation 0 0 1 1 translation 1 1 0.3 children [ Shape { geometry Box { size 2 1 .3 } appearance USE camiPaint } ] } ] } ] } ] } ] } ] } DEF AnimationControl Group { children [ DEF SetBoxDown IntegerTrigger { integerKey 0 } DEF SetBoxUp IntegerTrigger { integerKey 1 } ] ROUTE ClearSphere1.isActive TO SetBoxUp.set_boolean ROUTE ClearSphere2.isActive TO SetBoxDown.set_boolean ROUTE SetBoxUp.triggerValue TO ButtonChoice.whichChoice ROUTE SetBoxDown.triggerValue TO ButtonChoice.whichChoice } ] } DEF upperCarriagePiece Group { children [ DEF rotateUpperCarriage Transform { center 0 -2.5 0 children [ DEF upperCarriage Group { children [ DEF rightTrunion Transform { rotation 1 0 0 1.57 translation .6 1.2 .65 children [ Transform { rotation 0 1 0 3.14 children [ DEF left_stantion Shape { geometry Extrusion { crossSection [ 0 4 2 43 -4 5 -7 10 -712 -9 2 -9 0 -4 0 4 ] scale [ .1 .1 ] spine [ 0 0 0 .2 0 0 ] } appearance USE camiPaint } ] } ] } Transform { rotation 1 0 0 1.57 translation -.4 1.2 .65 children [ Transform { rotation 0 1 0 3.14 children [ USE left_stantion ] } ] } DEF leftHandwheel Transform { rotation 0 1 0 -1.57 scale .8 .8 .8 translation -.75 1 .5 children [ # This handwheel was copied from the Savage library from the LW155 howitzer DEF Crank LOD { range [ 25 ] children [ ### children2 DEF handwheelGroup Group { children [ DEF CircularHandle Transform { children [ Shape { geometry Extrusion { beginCap FALSE creaseAngle 1.57 crossSection [ 0.1 0 0.092 -0.038 0.071 -0.071 0.038 -0.092 0 -0.1 -0.038 -0.092 -0.071 -0.071 -0.092 -0.038 -0.1 0 -0.092 0.038 -0.071 0.071 -0.038 0.092 0 0.1 0.038 0.092 0.071 0.071 0.092 0.038 0.1 0 ] endCap FALSE scale [ 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ] spine [ 0.3 0 0 0.276 -0.114 0 0.213 -0.213 0 0.114 -0.276 0 0 -0.3 0 -0.114 -0.276 0 -0.213 -0.213 0 -0.276 -0.114 0 -0.3 0 0 -0.276 0.114 0 -0.213 0.213 0 -0.114 0.276 0 0 0.3 0 0.114 0.276 0 0.213 0.213 0 0.276 0.114 0 0.3 0 0 ] } appearance Appearance { material Material { diffuseColor .1 .10 .1 } } } ] } DEF CrankShaft Transform { translation 0 0 -0.05 children [ DEF Shaft Transform { rotation 1 0 0 1.57 children [ Shape { geometry Cylinder { height 0.02 radius 0.08 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } DEF Top Transform { rotation 1 0 0 1.57 translation 0 0 -0.1 children [ Shape { geometry Cylinder { height 0.2 radius 0.05 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } DEF TopBall Transform { translation 0 0 -0.01 children [ Shape { geometry Sphere { radius 0.05 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } ] } DEF Struts Transform { children [ DEF StrutOne Transform { rotation 1 0 0 0.21 translation 0 0.04 -0.05725 children [ Shape { geometry Extrusion { creaseAngle 3.14 crossSection [ 0.01 0 0.0092 -0.0038 0.0071 -0.0071 0.0038 -0.0092 0 -0.01 -0.0038 -0.0092 -0.0071 -0.0071 -0.0092 -0.0038 -0.01 0 -0.0092 0.0038 -0.0071 0.0071 -0.0038 0.0092 0 0.01 0.0038 0.0092 0.0071 0.0071 0.0092 0.0038 0.01 0 ] scale [ 4 2 2 2 2 2 2 2 2 4 ] spine [ 0 0 0 0 0.125 0 0 0.25 0 0 0.255 0 0 0.275 0 ] } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } DEF StrutTwo Transform { rotation 0 0 1 2.09 children [ USE StrutOne ] } DEF StrutThree Transform { rotation 0 0 -1 2.09 children [ USE StrutOne ] } ] } ] } WorldInfo { info [ "null node" ] } ] } ] } DEF rightHandwheel Transform { rotation 0 1 0 1.57 scale .8 .8 .8 translation .75 1 .5 children [ USE Crank ] } DEF traversingWheel Transform { rotation 0 1 0 -.85 scale .5 .5 .5 translation -.68 .5 .6 children [ USE Crank ] } Transform { translation 0 .25 0 children [ DEF traversingPlatform Shape { geometry Cylinder { height .35 radius .8 } appearance USE camiPaint } ] } DEF rightUpperCylinder Transform { rotation 0 0 1 1.57 translation 0 1.5 .2 children [ Transform { center 0 0 1 rotation 0 0 1 -3.14 children [ Transform { children [ DEF ruc Transform { center 0 0 .3 children [ DEF rucL Transform { rotation 1 0 0 -1.57 translation 0 -.48 0 children [ Transform { translation 0 .050 0 children [ DEF upperCylinder1 Shape { geometry Cylinder { height .45 radius .075 } appearance USE camiPaint } ] } Transform { translation 0 -.22 0 children [ DEF linkBolt Shape { geometry Sphere { radius .05 } appearance Appearance { material USE black } } ] } DEF shrinkCylinder Transform { translation 0 .22 0 children [ DEF upperExtender Shape { geometry Cylinder { height .55 radius .060 } appearance Appearance { texture ImageTexture { url [ "baffle.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/baffle.jpg" ] } } } ] } ] } DEF rucR Transform { rotation 1 0 0 -1.57 translation 0 .48 0 children [ Transform { translation 0 .050 0 children [ USE upperCylinder1 ] } Transform { translation 0 -.22 0 children [ USE linkBolt ] } DEF shrinkCylinderR Transform { translation 0 .22 0 children [ USE upperExtender ] } ] } ] } ] } ] } ] } ] } DEF barrelGroup Transform { rotation 0 0 1 -1.57 children [ DEF barrelMover1 Transform { center -1. 0 .45 rotation 0 0 1 .01 translation .2 0 0 children [ DEF tubeSensor CylinderSensor { description "sensor for tube elevation" maxAngle 0 minAngle -.65 } DEF theBarrel Transform { children [ DEF barrel Group { children [ DEF recoilTransform Transform { rotation 0 0 1 1.57 translation -.20 0 -.2 children [ DEF recoilMover Transform { children [ DEF tube1 Transform { rotation 1 0 0 -.84 translation 0 2.45 -1 children [ Transform { translation 0 -2.5 0 children [ Shape { geometry DEF tube Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] scale [ .2 .2 .2 .2 .18 .18 .18 .18 .2 .2 ] spine [ 0 0 0 0 3.5 0 0 3.6 0 0 4.7 0 0 5.2 0 ] } appearance USE camiPaint } DEF shinyPiece Transform { translation 0 3 0 children [ Shape { geometry Cylinder { height 1.1 radius .205 } appearance DEF shiny Appearance { material Material { diffuseColor .7 .7 .7 } } } ] } ] } DEF breech Transform { translation 0 -2.5 0 children [ Shape { geometry Cylinder { height .1 radius .2 } appearance USE shiny } ] } ] } DEF muzzle_break Transform { translation 0 .05 0 children [ Transform { rotation 1 0 0 .75 translation .25 4.48 -3.6 children [ Transform { rotation 0 0 1 1.57 children [ Transform { rotation 1 0 0 3.14 scale 1.6 .7 .85 children [ DEF muzzleBreak Shape { geometry Extrusion { crossSection [ 0 0 3 0 3 -3 2.8 -3.2 2.3 -3.7 2 -4 1 -4 .8 -3.8 .3 -3.3 0 -3 0 0 ] scale [ .25 .25 ] spine [ 0 0 0 .25 0 0 ] } appearance USE camiPaint } ] } ] } ] } Transform { rotation 1 0 0 .75 translation .25 4.4 -3.2 children [ Shape { geometry Box { size .01 .3 .4 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } Transform { rotation 1 0 0 .75 translation -.225 4.4 -3.2 children [ Shape { geometry Box { size .01 .3 .4 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } Transform { rotation 1 0 0 -.84 translation 0 4.64 -3.45 children [ Shape { geometry Cylinder { height .02 radius .17 } appearance Appearance { material Material { diffuseColor .1 .1 .1 } } } ] } ] } ] } DEF sideBars Transform { translation 0 -.2 0 children [ DEF rightSideBar Transform { rotation 1 0 0 .75 translation .45 1.9 -.250 children [ DEF sideBar Shape { geometry Box { size .2 .2 2.2 } appearance USE camiPaint } ] } DEF leftSideBar1 Transform { rotation 1 0 0 .75 translation -.45 1.9 -.250 children [ USE sideBar ] } DEF lTravelLockAnchor Transform { rotation 1 0 0 -2.3 translation -.55 1.7 -.2 children [ Shape { geometry Extrusion { crossSection [ 0 0 0 .15 .15 .15 .15 0 0 0 ] scale [ 1 .85 .75 .75 .5 .5 ] spine [ 0 0 0 0 .1 0 0 .2 0 ] } appearance USE camiPaint } ] } DEF travelLockAnchor Transform { rotation 1 0 0 -2.3 translation .4 1.7 -.2 children [ Shape { geometry Extrusion { crossSection [ 0 0 0 .15 .15 .15 .15 0 0 0 ] scale [ 1 .85 .75 .75 .5 .5 ] spine [ 0 0 0 0 .1 0 0 .2 0 ] } appearance USE camiPaint } ] } Transform { rotation 1 0 0 .65 translation .48 2.4 -1. children [ DEF upperTravelLocker Shape { geometry Box { size .07 .2 .04 } appearance USE camiPaint } ] } Transform { rotation 1 0 0 .65 translation -.48 2.4 -1 children [ USE upperTravelLocker ] } ] } Transform { rotation 1 0 0 -.84 translation 0 1.65 -.1 children [ DEF barrelCover Shape { geometry Cylinder { height 2.5 radius .4 } appearance USE camiPaint } ] } DEF travelLockPiece Transform { rotation 1 0 0 -.76 translation -.5 1.72 -.75 children [ DEF travelLockOrient Transform { center 0 -.5 0 rotation 1 0 0 -2.25 children [ Transform { children [ DEF travelLock Shape { geometry Cylinder { height 1 radius .05 } appearance USE camiPaint } ] } Transform { translation 1 0 0 children [ USE travelLock ] } Transform { rotation 0 0 1 .78 scale 1 1.38 1 translation .5 0 0 children [ USE travelLock ] } Transform { center 0 0 -.705 rotation 0 0 1 -.78 scale 1 1.38 1 translation .5 0 0 children [ USE travelLock ] } DEF connectingCylinder Transform { rotation 0 0 1 1.57 scale 1 .1 1 translation 0 .5 0 children [ USE travelLock ] } Transform { rotation 0 0 1 1.57 scale 1 .1 1 translation 0 -.5 0 children [ USE travelLock ] } Transform { rotation 0 0 1 1.57 scale 1 .1 1 translation 1 .5 0 children [ USE travelLock ] } Transform { rotation 0 0 1 1.57 scale 1 .1 1 translation 1 -.5 0 children [ USE travelLock ] } ] } DEF travelLockOrientor OrientationInterpolator { key [ 0 .25 .5 .75 .85 1 ] keyValue [ 1 0 0 -2.25 1 0 0 -1.7 1 0 0 -1.25 1 0 0 -.75 1 0 0 -.5 1 0 0 0 ] } DEF travelLockSensor TouchSensor { description "rasies and lowers travel lock" } DEF travelLockClock TimeSensor { cycleInterval 5 } ] ROUTE travelLockSensor.touchTime TO travelLockClock.set_startTime ROUTE travelLockClock.fraction_changed TO travelLockOrientor.set_fraction ROUTE travelLockOrientor.value_changed TO travelLockOrient.set_rotation } DEF theRound Transform { rotation 1 0 0 -.77 translation 0 3.7 -2.5 children [ DEF theRoundSpinner Transform { children [ Transform { children [ Transform { scale .2 1 .2 children [ DEF artyRound Shape { appearance USE camiPaint geometry Extrusion { crossSection [ -1 0 -0.9 0.435889894354067 -0.8 0.6 -0.7 0.714142842854285 -0.6 0.8 -0.5 0.866025403784439 -0.4 0.916515138991168 -0.3 0.953939201416946 -0.2 0.979795897113271 -0.1 0.99498743710662 0 1 0.1 0.99498743710662 0.2 0.979795897113271 0.3 0.953939201416946 0.4 0.916515138991168 0.5 0.866025403784439 0.6 0.8 0.7 0.714142842854285 0.8 0.6 0.9 0.435889894354067 1 0 0.9 -0.435889894354067 0.8 -0.6 0.7 -0.714142842854285 0.6 -0.8 0.5 -0.866025403784439 0.4 -0.916515138991168 0.3 -0.953939201416946 0.2 -0.979795897113271 0.1 -0.99498743710662 0 -1 -0.1 -0.99498743710662 -0.2 -0.979795897113271 -0.3 -0.953939201416946 -0.4 -0.916515138991168 -0.5 -0.866025403784439 -0.6 -0.8 -0.7 -0.714142842854285 -0.8 -0.6 -0.9 -0.435889894354067 -1 0 ] scale [ .35 .35 .5 .5 .5 .5 .3 .3 .01 .01 ] spine [ 0 0 0 0 .15 0 0 .8 0 0 .9 0 0 1 0 ] } } ] } ] } DEF spinTimer TimeSensor { cycleInterval 3 loop TRUE } DEF roundSpinner OrientationInterpolator { key [ 0.0 0.25 0.50 0.75 1.0 ] keyValue [ 0 1 0 -1.57 0 1 0 0 0 1 0 1.57 0 1 0 3.14 0 1 0 -1.57 ] } ] } DEF roundPathInterpolator PositionInterpolator { key [ 0.057 0.0858823529 0.088235294 0.117647059 0.147058824 0.176470588 0.205882353 0.235294118 0.264705882 0.294117647 0.323529412 0.352941176 0.382352941 0.411764706 0.441176471 0.470588235 0.5 0.529411765 0.558823529 0.588235294 0.617647059 0.647058824 0.676470588 0.705882353 0.735294118 0.764705882 0.794117647 0.823529412 0.852941176 0.882352941 0.911764706 0.941176471 0.970588235 ] keyValue [ 0 3.8 -2.6 0 30.6227766 -10 0 59.2455532 -20 0 85.86832981 -30 0 110.4911064 -40 0 133.113883 -50 0 153.7366596 -60 0 172.3594362 -70 0 188.9822128 -80 0 203.6049894 -90 0 216.227766 -100 0 226.8505426 -110 0 235.4733192 -120 0 242.0960958 -130 0 246.7188724 -140 0 249.341649 -150 0 249.9644256 -160 0 248.5872022 -170 0 245.2099788 -180 0 239.8327554 -190 0 232.455532 -200 0 223.0783086 -210 0 211.7010852 -220 0 198.3238618 -230 0 182.9466384 -240 0 165.569415 -250 0 146.1921916 -260 0 124.8149682 -270 0 101.4377448 -280 0 76.06052145 -290 0 48.68329805 -300 0 19.30607465 -310 0 -1 -320 ] } DEF roundOrientationInterpolator OrientationInterpolator { key [ 0.029411765 0.058823529 0.088235294 0.117647059 0.147058824 0.176470588 0.205882353 0.235294118 0.264705882 0.294117647 0.323529412 0.352941176 0.382352941 0.411764706 0.441176471 0.470588235 0.5 0.529411765 0.558823529 0.588235294 0.617647059 0.647058824 0.676470588 0.705882353 0.735294118 0.764705882 0.794117647 0.823529412 0.852941176 0.882352941 0.911764706 0.941176471 0.970588235 ] keyValue [ 1 0 0 -1.03580267483729 1 0 0 -1.07069156372618 1 0 0 -1.10558045261507 1 0 0 -1.14046934150396 1 0 0 -1.17535823039285 1 0 0 -1.21024711928174 1 0 0 -1.24513600817063 1 0 0 -1.28002489705952 1 0 0 -1.31491378594841 1 0 0 -1.34980267483729 1 0 0 -1.38469156372618 1 0 0 -1.41958045261507 1 0 0 -1.45446934150396 1 0 0 -1.48935823039285 1 0 0 -1.52424711928174 1 0 0 -1.55913600817063 1 0 0 -1.59402489705952 1 0 0 -1.6289137859484 1 0 0 -1.66380267483729 1 0 0 -1.69869156372618 1 0 0 -1.73358045261507 1 0 0 -1.76846934150396 1 0 0 -1.80335823039285 1 0 0 -1.83824711928174 1 0 0 -1.87313600817063 1 0 0 -1.90802489705952 1 0 0 -1.9429137859484 1 0 0 -1.97780267483729 1 0 0 -2.01269156372618 1 0 0 -2.04758045261507 1 0 0 -2.08246934150396 1 0 0 -2.11735823039285 1 0 0 -2.15224711928174 ] } DEF rideTheRound Viewpoint { description "ride the round" orientation 1 0 0 .45 position 0 -5 10 } ] } DEF RECOILTIMER TimeSensor { cycleInterval 5 } DEF recoil PositionInterpolator { key [ 0 .2 .4 .6 .8 1 ] keyValue [ 0 0 0 0 -.20 .25 0 -.40 .5 0 -.20 .25 0 -.10 .15 0 0 0 ] } ] ROUTE RECOILTIMER.fraction_changed TO recoil.set_fraction ROUTE recoil.value_changed TO recoilMover.set_translation } DEF shotEffects Transform { rotation 1 0 0 1.57 translation -4.7 0 -3.5 children [ DEF hotGas Transform { rotation 0 0 1 -.76 translation -.3 -.3 0 children [ Group { children [ DEF BallTransform Transform { scale .000001 .0000001 .0000001 children [ Shape { geometry DEF EXPSHAPE Sphere { radius 25 } appearance Appearance { # explosion.png is from the Pearl Harbor scene from www.planetnine.com. texture DEF explosion ImageTexture { url [ "explosion.png" "https://savage.nps.edu/Savage/GroundVehicles/T72M/explosion.png" "https://savage.nps.edu/Savage/Weapons/Missiles/explosion.png" ] } } } ] } DEF BALLSIZE PositionInterpolator { key [ 0.0 0.1 0.2 .3 .4 .5 .6 .7 .8 .9 1.0 ] keyValue [ 0 0 0 .003 .001 .003 .006 .002 .006 .01 .003 .01 .015 .006 .015 .02 .02 .02 .01 .01 .01 .006 .006 .006 .003 .003 .003 0 0 0 0 0 0 ] } DEF BOOMCLOCK TimeSensor { cycleInterval .85 } ] } ] } Transform { rotation 0 0 1 -.76 children [ DEF BoomTransform Transform { scale 0.0001 0.00001 0.00001 translation 0.0 0 0.0 children [ Shape { geometry Extrusion { beginCap FALSE creaseAngle 1.57 crossSection [ 1.0 0.0 0.92 -0.38 0.71 -0.71 0.38 -0.92 0.0 -1.0 -0.38 -0.92 -0.71 -0.71 -0.92 -0.38 -1.0 -0.0 -0.92 0.38 -0.71 0.71 -0.38 0.92 0.0 1.0 0.38 0.92 0.71 0.71 0.92 0.38 1.0 0.0 ] endCap FALSE spine [ 2.0 0.0 0.0 1.85 0.0 0.77 1.41 0.0 1.41 0.77 0.0 1.85 0.0 0.0 2.0 -0.77 0.0 1.85 -1.41 0.0 1.41 -1.85 0.0 0.77 -2.0 0.0 0.0 -1.85 0.0 -0.77 -1.41 0.0 -1.41 -0.77 0.0 -1.85 0.0 0.0 -2.0 0.77 0.0 -1.85 1.41 0.0 -1.41 1.85 0.0 -0.77 2.0 0.0 0.0 ] } appearance Appearance { material DEF BoomMaterial Material { } texture ImageTexture { url [ "Boom1.jpg" "https://savage.nps.edu/Savage/GroundVehicles/T72M/Boom1.jpg" "https://savage.nps.edu/Savage/ShipsMilitary/FrigateYavuzTurkey/Boom1.jpg" ] } } } DEF TransparencyInterp ScalarInterpolator { key [ 0 0.04 0.1 0.7 1.0 ] keyValue [ 1.0 0.2 0.3 1.0 1.0 ] } DEF ScaleInterp PositionInterpolator { key [ 0 0.04 0.1 0.7 1.0 ] keyValue [ 0.00001 0.00001 0.00001 0.05 0.4 0.05 0.4 0.6 0.4 0.5 0.9 0.5 0.00001 0.0001 0.00001 ] } DEF BoomTimer TimeSensor { cycleInterval 5.0 } ] } ] ROUTE BOOMCLOCK.fraction_changed TO BALLSIZE.set_fraction ROUTE BALLSIZE.value_changed TO BallTransform.set_scale ROUTE BoomTimer.fraction_changed TO ScaleInterp.set_fraction ROUTE ScaleInterp.value_changed TO BoomTransform.set_scale ROUTE BoomTimer.fraction_changed TO TransparencyInterp.set_fraction ROUTE TransparencyInterp.value_changed TO BoomMaterial.set_transparency } ] } ] } ] } DEF elevMechMover1 Transform { children [ Transform { children [ Transform { rotation 0 0 1 1.57 children [ Transform { rotation 1 0 0 -.25 translation .45 1.7 -.3 children [ DEF elevatingMech1 Shape { geometry Cylinder { height 1.3 radius .08 } appearance USE camiPaint } Transform { translation 0 -1 0 children [ DEF lowerElevMechExtender Shape { geometry Cylinder { height 1 radius .070 } appearance Appearance { material Material { diffuseColor .7 .7 .7 } } } ] } ] } Transform { rotation 1 0 0 -.25 translation -.45 1.7 -0.3 children [ USE elevatingMech1 Transform { translation 0 -1 0 children [ USE lowerElevMechExtender ] } ] } ] } ] } ] } ] ROUTE tubeSensor.rotation_changed TO barrelMover1.set_rotation } DEF upperCylinderMover Script { inputOnly SFRotation barrelRotation outputOnly SFRotation upperRotation outputOnly SFVec3f shrinkCylinder outputOnly SFVec3f extendCylinder url [ "ecmascript: function barrelRotation (value, eventTime ) { angle = value[3]; outputAngle = .75 * angle; upperRotation = new SFRotation ( 0, 1, 0, outputAngle); extendCylinder = new SFVec3f ( 0, .22 + (-.7 * angle), 0); shrinkCylinder = new SFVec3f (1, 1.02 * (.85 - angle), 1); } " ] } ] ROUTE tubeSensor.rotation_changed TO upperCylinderMover.barrelRotation ROUTE upperCylinderMover.upperRotation TO ruc.set_rotation ROUTE upperCylinderMover.extendCylinder TO shrinkCylinder.set_translation ROUTE upperCylinderMover.shrinkCylinder TO shrinkCylinder.set_scale ROUTE upperCylinderMover.extendCylinder TO shrinkCylinderR.set_translation ROUTE upperCylinderMover.shrinkCylinder TO shrinkCylinderR.set_scale } DEF carriage_sensor CylinderSensor { description "sensor for upper carriage deflection" maxAngle .90 minAngle -.90 } ] ROUTE carriage_sensor.rotation_changed TO rotateUpperCarriage.set_rotation } ] } ] } Background { backUrl [ "sky2.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/sky2.jpg" ] frontUrl [ "sky2.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/sky2.jpg" ] leftUrl [ "sky2.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/sky2.jpg" ] rightUrl [ "sky2.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/sky2.jpg" ] topUrl [ "sky2.jpg" "https://savage.nps.edu/Savage/Weapons/Guns/sky2.jpg" ] } DEF target Viewpoint { description "as seen from target" orientation 0 0.995 -0.097 3.14 position 0 10 -372 } DEF theGround Transform { translation 0 -1.5 0 children [ Transform { scale 100 .3 100 children [ Inline { url [ "../../../Vrml2Sourcebook/Chapter14-ElevationGrid/Figure14.5ElevationGridTerrain.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter14-ElevationGrid/Figure14.5ElevationGridTerrain.x3d" "../../../Vrml2Sourcebook/Chapter14-ElevationGrid/Figure14.5ElevationGridTerrain.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter14-ElevationGrid/Figure14.5ElevationGridTerrain.wrl" ] } ] } ] } ROUTE wheelSensor.isOver TO CLOCK.set_enabled ROUTE CLOCK.fraction_changed TO wheelInterpolator.set_fraction ROUTE wheelInterpolator.value_changed TO leftWheel1.set_rotation DEF fireTheRound Transform { translation 5 3 -5 children [ DEF fireMe Billboard { children [ Transform { translation -1 -.35 0 children [ Shape { geometry Text { string [ "FIRE!" ] fontStyle FontStyle { justify [ "MIDDLE" "MIDDLE" ] } } appearance Appearance { material Material { emissiveColor .9 .9 .9 } } } ] } Shape { geometry DEF sign Box { size 4 2 .2 } appearance Appearance { material Material { transparency .6 } texture USE camo } } ] } DEF shootRound TouchSensor { description "touch muzzlebreak to shoot round" } DEF clock3 TimeSensor { cycleInterval 15 } ] } DEF targetSphere Transform { translation 0 0 -320 children [ Transform { children [ Shape { geometry Box { size 10 1 10 } appearance USE camiPaint } DEF explosionsoundsensor ProximitySensor { size 200 400 300 } ] } DEF explosionSounds Sound { maxBack 100 maxFront 100 minBack .01 minFront .01 source DEF explosionSound AudioClip { description "explosion sound" url [ "ShellExplode.au" "https://savage.nps.edu/Savage/Weapons/Guns/ShellExplode.au" ] } } ] ROUTE explosionsoundsensor.enterTime TO explosionSound.startTime } Transform { scale .2 1 .2 translation 5 0 0 children [ USE artyRound ] } Transform { scale .2 1 .2 translation 5.2 0 0 children [ USE artyRound ] } Transform { scale .2 1 .2 translation 5.4 0 0 children [ USE artyRound ] } Transform { } ROUTE shootRound.touchTime TO BoomTimer.set_startTime ROUTE shootRound.touchTime TO RECOILTIMER.set_startTime ROUTE shootRound.touchTime TO BOOMCLOCK.set_startTime ROUTE shootRound.touchTime TO clock3.set_startTime ROUTE shootRound.touchTime TO CannonFireSound.startTime ROUTE clock3.fraction_changed TO roundPathInterpolator.set_fraction ROUTE clock3.fraction_changed TO roundOrientationInterpolator.set_fraction ROUTE roundPathInterpolator.value_changed TO theRound.set_translation ROUTE roundOrientationInterpolator.value_changed TO theRound.set_rotation ROUTE shootRound.touchTime TO spinTimer.set_startTime ROUTE spinTimer.fraction_changed TO roundSpinner.set_fraction ROUTE roundSpinner.value_changed TO theRoundSpinner.set_rotation