package Savage.ShipsMilitary.CruiserUnitedStates; /* Copyright (c) 1995-2019 held by the author(s). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Web3D Consortium (http://www.web3D.org) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.util.*; import org.web3d.x3d.jsail.Core.*; import org.web3d.x3d.jsail.EnvironmentalEffects.*; import org.web3d.x3d.jsail.fields.*; import org.web3d.x3d.jsail.Geometry3D.*; import org.web3d.x3d.jsail.Grouping.*; import org.web3d.x3d.jsail.Navigation.*; import org.web3d.x3d.jsail.Networking.*; import org.web3d.x3d.jsail.Rendering.*; import org.web3d.x3d.jsail.Shape.*; // Javadoc annotations follow, see below for source. /** *

Generic cruiser-class ship modified to be a surface target for the ArleighBurke model.

Related links: TargetShip.java source, TargetShip catalog page, X3D Resources, X3D Scene Authoring Hints, and X3D Tooltips.

meta tags   Document Metadata
title TargetShip.x3d
creator Ugur Demiryurek, Mike Hunsberger
modified by James Harney
created 15 October 2000
modified 15 November 2004
description Generic cruiser-class ship modified to be a surface target for the ArleighBurke model.
identifier https://savage.nps.edu/Savage/ShipsMilitary/Cruiser-UnitedStates/TargetShip.x3d
generator X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit
license ../../license.html
 

This program uses the X3D Java Scene Access Interface Library (X3DJSAIL). It has been produced using the X3dToJava.xslt stylesheet to create Java source code from an .x3d model.

* @author Ugur Demiryurek, Mike Hunsberger */ public class TargetShip { /** Default constructor to create this object. */ public TargetShip () { initialize(); } /** Create and initialize the X3D model for this object. */ public final void initialize() { x3dModel = new X3DObject().setProfile(X3DObject.PROFILE_IMMERSIVE).setVersion(X3DObject.VERSION_3_1) .setHead(new headObject() .addMeta(new metaObject().setName(metaObject.NAME_TITLE ).setContent("TargetShip.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_CREATOR ).setContent("Ugur Demiryurek, Mike Hunsberger")) .addMeta(new metaObject().setName("modified by").setContent("James Harney")) .addMeta(new metaObject().setName(metaObject.NAME_CREATED ).setContent("15 October 2000")) .addMeta(new metaObject().setName(metaObject.NAME_MODIFIED ).setContent("15 November 2004")) .addMeta(new metaObject().setName(metaObject.NAME_DESCRIPTION).setContent("Generic cruiser-class ship modified to be a surface target for the ArleighBurke model.")) .addMeta(new metaObject().setName(metaObject.NAME_IDENTIFIER ).setContent("https://savage.nps.edu/Savage/ShipsMilitary/Cruiser-UnitedStates/TargetShip.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR ).setContent("X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit")) .addMeta(new metaObject().setName(metaObject.NAME_LICENSE ).setContent("../../license.html"))) .setScene(new SceneObject() .addChild(new ViewpointObject("SideView").setDescription("Right Side View").setPosition(-5.0f,15.0f,150.0f)) .addChild(new ViewpointObject().setDescription("Back View").setOrientation(0.0f,1.0f,0.0f,-1.5f).setPosition(-150.0f,10.0f,0.0f)) .addChild(new ViewpointObject("FrontView").setDescription("Front View").setOrientation(0.0f,-1.0f,0.0f,-1.5f).setPosition(100.0f,10.0f,0.0f)) .addChild(new ViewpointObject("TopView").setDescription("Top View").setOrientation(1.0f,0.0f,0.0f,-1.1f).setPosition(0.0f,150.0f,75.0f)) .addChild(new BackgroundObject().setGroundColor(new MFColorObject(new float[] {0.0f,0.0f,0.0f})).setSkyColor(new MFColorObject(new float[] {0.0f,0.5f,.5f}))) .addComments(" Scene nodes are added here ") .addChild(new TransformObject().setTranslation(1.13f,1.0f,1.0f) .addChild(new TransformObject("CRUSIERMAINBODY") .addChild(new ShapeObject("BelowWaterHull") .setAppearance(new AppearanceObject("Black") .setMaterial(new MaterialObject().setDiffuseColor(.1f,.1f,.1f))) .setGeometry(new ExtrusionObject().setCreaseAngle(0.85f).setCrossSection(new MFVec2fObject(new float[] {0.0f,8.4f,4.412f,6.65f,4.412f,-6.65f,0.0f,-8.4f,0.0f,8.4f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,.45f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,-.785f})).setScale(new MFVec2fObject(new float[] {1.1f,1.0f,1.0f,1.0f,1.9f,.02f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-82.00f,0.0f,0.0f,45.0f,0.0f,0.0f,70.0f,0.0f,0.0f})))) .addChild(new ShapeObject("BottomHull") .setAppearance(new AppearanceObject("HullGrey") .setMaterial(new MaterialObject().setDiffuseColor(.62f,.639f,.612f))) .setGeometry(new ExtrusionObject().setCreaseAngle(0.85f).setCrossSection(new MFVec2fObject(new float[] {-2.206f,9.65f,0.0f,8.4f,0.0f,-8.4f,-2.206f,-9.65f,-2.206f,9.65f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,.45f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,-.785f})).setScale(new MFVec2fObject(new float[] {1.1f,1.0f,1.0f,1.0f,1.9f,.02f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-82.0f,0.0f,0.0f,45.0f,0.0f,0.0f,70.0f,0.0f,0.0f})))) .addChild(new ShapeObject("CenterHull") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCreaseAngle(0.7f).setCrossSection(new MFVec2fObject(new float[] {-4.67f,9.65f,-2.206f,9.65f,-2.206f,-9.65f,-4.67f,-9.65f,-4.67f,9.65f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,-.785f})).setScale(new MFVec2fObject(new float[] {1.0f,1.0f,1.0f,1.0f,1.9f,.02f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-83.0f,0.0f,0.0f,45.0f,0.0f,0.0f,70.0f,0.0f,0.0f})))) .addChild(new ShapeObject("UpperHullFwd") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCreaseAngle(0.7f).setCrossSection(new MFVec2fObject(new float[] {-7.0f,9.65f,-4.67f,9.65f,-4.67f,-9.65f,-7.0f,-9.65f,-7.0f,9.65f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,-.6f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,-.785f})).setScale(new MFVec2fObject(new float[] {1.2f,1.0f,1.0f,1.0f,1.9f,.02f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {40.0f,0.0f,0.0f,45.0f,0.0f,0.0f,70.0f,0.0f,0.0f})))) .addChild(new ShapeObject("MissileDeck") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCreaseAngle(1.2f).setCrossSection(new MFVec2fObject(new float[] {-55.5f,-2.5f,-55.5f,2.5f,-50.3f,9.65f,45.0f,9.65f,45.0f,-9.65f,-50.3f,-9.65f,-55.5f,-2.5f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {0.0f,2.0f,0.0f,0.0f,6.9f,0.0f}))))) .addChild(new TransformObject("FRONTGUN").setRotation(1.0f,0.05f,0.0f,-1.57f).setScale(0.7f,0.7f,0.7f).setTranslation(55.0f,9.4f,1.5f) .addChild(new TransformObject("FrontGunBody").setScale(0.5f,0.5f,0.7f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCreaseAngle(1.5f).setCrossSection(new MFVec2fObject(new float[] {-6.0f,0.0f,-5.9f,0.7f,-5.7f,1.2f,-5.3f,1.7f,-5.0f,2.1f,-4.0f,2.2f,-3.0f,2.3f,-2.0f,2.4f,0.0f,2.5f,1.0f,2.6f,2.0f,2.65f,3.0f,2.25f,4.0f,1.7f,5.0f,1.0f,6.0f,0.0f,7.0f,-2.5f,-5.5f,-2.5f,-6.0f,0.0f})).setSpine(new MFVec3fObject(new float[] {0.0f,1.0f,0.0f,0.0f,7.0f,0.0f}))))) .addChild(new TransformObject("FrontGunFire").setRotation(-0.3f,0.0f,1.0f,1.57f).setTranslation(4.0f,2.1f,1.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setBottom(false).setHeight(10f).setRadius(0.2f).setTop(false)))) .addChild(new TransformObject("FrontGunBottom1").setRotation(1.0f,0.0f,0.0f,1.57f).setTranslation(0.0f,2.2f,-2.2f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(0.25f).setRadius(4f)))) .addChild(new TransformObject("FrontGunBottom2").setRotation(1.0f,0.0f,0.0f,1.57f).setTranslation(0.0f,2.0f,-2.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(0.5f).setRadius(1.25f))))) .addChild(new TransformObject("BACKGUN").setRotation(0.0f,1.0f,1.0f,-3.1f).setTranslation(-65.0f,7.0f,-1.8f) .addChild(new TransformObject("BackGunBody").setScale(0.5f,0.5f,0.7f) .addChild(new ShapeObject("gun") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCreaseAngle(1.5f).setCrossSection(new MFVec2fObject(new float[] {-6.0f,0.0f,-5.9f,0.7f,-5.7f,1.2f,-5.3f,1.7f,-5.0f,2.1f,-4.0f,2.2f,-3.0f,2.3f,-2.0f,2.4f,0.0f,2.5f,1.0f,2.6f,2.0f,2.65f,3.0f,2.25f,4.0f,1.7f,5.0f,1.0f,6.0f,0.0f,7.0f,-2.5f,-5.5f,-2.5f,-6.0f,0.0f})).setSpine(new MFVec3fObject(new float[] {0.0f,1.0f,0.0f,0.0f,7.0f,0.0f}))))) .addChild(new TransformObject("BackGunFirePipe").setRotation(-0.3f,0.0f,1.0f,1.57f).setTranslation(4.0f,2.1f,1.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setBottom(false).setHeight(10f).setRadius(0.2f).setTop(false)))) .addChild(new TransformObject("BackGunBottom1").setRotation(1.0f,0.0f,0.0f,1.57f).setTranslation(0.0f,2.2f,-2.2f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(0.25f).setRadius(4f)))) .addChild(new TransformObject("BackGunBottom2").setRotation(1.0f,0.0f,0.0f,1.57f).setTranslation(0.0f,2.5f,-2.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(0.5f).setRadius(1.25f))))) .addChild(new TransformObject("HARPOON").setScale(1.3f,1.3f,1.3f).setTranslation(-77.5f,7.9f,-6.2f) .addChild(new TransformObject("HarpoonBunch1").setTranslation(0.0f,0.1f,0.0f) .addChild(new GroupObject("HarpoonBunch") .addChild(new TransformObject().setTranslation(0.0f,-0.245f,0.0f) .addChild(new GroupObject("Harpoon") .addChild(new TransformObject().setRotation(1.0f,0.0f,0.0f,-0.5f) .addChild(new ShapeObject("HarpoonWithHolders") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(5f).setRadius(0.25f))) .addChild(new TransformObject("HarpoonDownHolder").setTranslation(0.0f,-1.5f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject())) .setGeometry(new BoxObject().setSize(0.5f,0.2f,0.5f)))) .addChild(new TransformObject("HarpoonTopHolder").setTranslation(0.0f,1.5f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject())) .setGeometry(new BoxObject().setSize(0.5f,0.2f,0.5f))))))) .addChild(new TransformObject().setTranslation(0.5f,-0.245f,0.0f) .addChild(new GroupObject().setUSE("Harpoon"))) .addChild(new TransformObject().setTranslation(0.0f,0.0f,0.5f) .addChild(new GroupObject().setUSE("Harpoon"))) .addChild(new TransformObject().setTranslation(0.5f,0.0f,0.5f) .addChild(new GroupObject().setUSE("Harpoon"))) .addChild(new TransformObject().setRotation(1.0f,0.0f,0.0f,-0.5f).setTranslation(0.25f,-0.45f,-0.26f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(1.05f,5.0f,0.1f)))))) .addChild(new TransformObject("HarpoonBunch2").setRotation(1.0f,0.0f,0.0f,-1.7f).setTranslation(-1.1f,-0.77f,0.7f) .addChild(new GroupObject().setUSE("HarpoonBunch"))) .addChild(new TransformObject("HarpoonSupport1").setTranslation(-0.85f,-2.25f,0.5f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(1.0f,1.5f,0.1f)))) .addChild(new TransformObject("HarpoonSupport2").setTranslation(0.225f,-1.85f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(1.0f,1.5f,0.1f))))) .addChild(new TransformObject("Cruiser_Superstructure").setScale(1.0f,0.78f,0.8f).setTranslation(4.0f,-2.5f,0.0f) .addChild(new GroupObject("Rear-Superstructure-grouping") .addChild(new TransformObject("Rear-Superstructure").setTranslation(-55.0f,10.0f,0.0f) .addChild(new TransformObject().setTranslation(6.0f,0.0f,0.0f) .addChild(new ShapeObject("FlightDeckStructure") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {0.0f,-5.5f,2.5f,-7.25f,22.0f,-7.25f,22.0f,7.25f,2.5f,7.25f,0.0f,5.5f,0.0f,-5.5f})).setSpine(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,4.0f,0.0f}))))) .addChild(new ShapeObject("RightSideFlightDeck") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {20.0f,7.25f,21.0f,9.65f,44.5f,9.65f,44.5f,7.25f,20.0f,7.25f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,4.0f,0.0f})))) .addChild(new ShapeObject("LeftSideFlightDeck") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {20.0f,-7.25f,21.0f,-9.65f,44.5f,-9.65f,44.5f,-7.25f,20.0f,-7.25f})).setSpine(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,4.0f,0.0f})))) .addChild(new ShapeObject("RearStructure1") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {28.0f,-7.25f,44.5f,-7.25f,44.5f,7.25f,28.0f,7.25f,28.0f,-7.25f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,13.5f,0.0f})))) .addChild(new ShapeObject("RearStructure1-Top1") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {28.0f,2.0f,35.0f,2.0f,35.0f,7.25f,28.0f,7.25f,28.0f,2.0f})).setSpine(new MFVec3fObject(new float[] {0.0f,13.5f,0.0f,0.0f,18.5f,0.0f})))) .addChild(new ShapeObject("RearStructureTop2") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new ExtrusionObject().setCcw(false).setCreaseAngle(.7f).setCrossSection(new MFVec2fObject(new float[] {35.0f,3.0f,44.5f,3.0f,44.5f,7.25f,35.0f,7.25f,35.0f,3.0f})).setSpine(new MFVec3fObject(new float[] {0.0f,13.5f,0.0f,0.0f,20.5f,0.0f})))) .addChild(new TransformObject("Stack1-Rear-LargeStructure").setTranslation(38.0f,23.0f,5.0f) .addChild(new ShapeObject("Stack1") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(5f).setRadius(2f).setTop(false))) .addChild(new ShapeObject("InnerStack") .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.0f,0.0f))) .setGeometry(new CylinderObject().setHeight(4.9f).setRadius(1.9f)))) .addChild(new TransformObject("Stack2-Rear-LargeStructure").setTranslation(42.0f,23.0f,5.0f) .addChild(new ShapeObject().setUSE("Stack1")) .addChild(new ShapeObject().setUSE("InnerStack"))) .addChild(new TransformObject("Rear-Large-Structure-Top") .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new IndexedFaceSetObject().setCcw(false).setSolid(false).setCoordIndex(new int[] {4,5,6,7,-1,0,1,2,3,-1,0,1,5,4,-1,1,2,6,5,-1,2,3,7,6,-1,0,4,7,3}) .addComments(" top, bottom, front, left, back, right ") .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {28.0f,13.5f,2.0f,28.0f,13.5f,-7.25f,44.5f,13.5f,-7.25f,44.5f,13.5f,2.0f,28.0f,23.5f,2.0f,28.0f,23.5f,-5.25f,44.5f,23.5f,-5.25f,44.5f,23.5f,2.0f})))))))) .addChild(new GroupObject("Front-Superstructure-Grouping") .addChild(new TransformObject("Front-Superstructure").setTranslation(4.0f,10.0f,0.0f) .addChild(new TransformObject("Front-Super-RearBox").setTranslation(12.0f,4.5f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(24.0f,9.0f,12.0f)))) .addChild(new TransformObject("Front-Super-RearBox-upper").setTranslation(12.0f,11.0f,0.0f) .addChild(new ShapeObject("LargeStructureTop1") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(24.0f,4.0f,8.0f)))) .addChild(new TransformObject("Front-Super-RearBox-small-upper").setTranslation(12.0f,16.0f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(12.0f,6.0f,6.0f)))) .addChild(new TransformObject("Front-Super-Stack").setTranslation(10.5f,21.0f,0.0f) .addChild(new ShapeObject("Front-Super-Stack1") .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new CylinderObject().setHeight(5f).setRadius(2f).setTop(false))) .addChild(new ShapeObject("Front-InnerStack") .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.0f,0.0f))) .setGeometry(new CylinderObject().setHeight(4.9f).setRadius(1.9f)))) .addChild(new TransformObject("Front-Super-Stack2").setTranslation(15.0f,21.0f,0.0f) .addChild(new ShapeObject().setUSE("Front-Super-Stack1")) .addChild(new ShapeObject().setUSE("Front-InnerStack"))) .addChild(new TransformObject("Front-Super-FrontBox").setTranslation(30.0f,4.0f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(12.0f,8.0f,12.0f)))) .addChild(new TransformObject("Front-Super-FrontBox-Top") .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new IndexedFaceSetObject().setCcw(false).setSolid(false).setCoordIndex(new int[] {4,5,6,7,-1,0,1,2,3,-1,0,1,5,4,-1,1,2,6,5,-1,2,3,7,6,-1,0,4,7,3}) .addComments(" top, bottom, front, left, back, right ") .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {24.0f,8.0f,6.0f,24.0f,8.0f,-6.0f,36.0f,8.0f,-6.0f,36.0f,8.0f,6.0f,24.0f,13.5f,5.0f,24.0f,13.5f,-5.0f,34.0f,13.5f,-5.0f,34.0f,13.5f,5.0f})))))) .addChild(new TransformObject("Front-Super-Bridge").setTranslation(28.0f,14.0f,0.0f) .addChild(new TransformObject("Front-Super-Bridge-Lower").setTranslation(0.0f,.25f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(8.0f,1.5f,6.0f)))) .addChild(new TransformObject("Front-Super-Bridge-Windows").setTranslation(0.0f,1.75f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setTransparency(.6f))) .setGeometry(new BoxObject().setSize(8.0f,1.5f,6.0f)))) .addChild(new TransformObject("Front-Super-Bridge-Roof").setTranslation(0.0f,2.5f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(8.0f,.1f,6.0f)))) .addChild(new TransformObject("Front-Super-Bridge-Back").setTranslation(-4.0f,1.0f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(.1f,3.0f,6.0f))))) .addChild(new TransformObject("Front-Super-antenna").setScale(1.0f,1.2f,1.0f).setTranslation(21.0f,13.0f,0.0f) .addChild(new InlineObject("AntennaMast").setUrl(new String[] {"../Destroyer-Sovremenny-Russia/AntennaMast.wrl","https://savage.nps.edu/Savage/ShipsMilitary/Destroyer-Sovremenny-Russia/AntennaMast.wrl","../Destroyer-Sovremenny-Russia/AntennaMast.x3d","https://savage.nps.edu/Savage/ShipsMilitary/Destroyer-Sovremenny-Russia/AntennaMast.x3d"}))))) .addChild(new GroupObject("Mid-Superstructure-Grouping") .addChild(new TransformObject("Mid-Super-Box").setTranslation(-3.0f,10.5f,0.0f) .addChild(new TransformObject().setTranslation(0.0f,6.0f,0.0f) .addChild(new ShapeObject() .setAppearance(new AppearanceObject().setUSE("HullGrey")) .setGeometry(new BoxObject().setSize(15.0f,13.0f,8.0f))))) .addChild(new TransformObject("Mid-Super-antenna").setScale(1.3f,1.8f,1.3f).setTranslation(0.0f,23.0f,0.0f) .addChild(new InlineObject().setUSE("AntennaMast"))))))); } // end of initialize() method /** The initialized model object, created within initialize() method. */ private X3DObject x3dModel; /** Provide a * shallow copy * of the X3D model. * @see X3DObject * @return TargetShip model */ public X3DObject getX3dModel() { return x3dModel; } /** Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object. * @param args array of input parameters, provided as arguments * @see X3DObject.handleArguments(args) * @see X3DObject.validationReport() * @see CommandLine * @see CommandLine.USAGE * @see ConfigurationProperties */ public static void main(String args[]) { X3DObject thisExampleX3dObject = new TargetShip().getX3dModel(); boolean hasArguments = (args != null) && (args.length > 0); boolean validate = true; // default boolean argumentsLoadNewModel = false; String fileName = new String(); if (args != null) { for (String arg : args) { if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate")) { validate = true; // making sure } if (arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3D) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_CLASSICVRML) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3DB) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_VRML97) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_EXI) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_GZIP) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_ZIP) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_HTML) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_XHTML)) { argumentsLoadNewModel = true; fileName = arg; } } } if (argumentsLoadNewModel) System.out.println("WARNING: \"TargetShip\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored."); else if (hasArguments) // if no arguments provided, this method produces usage warning thisExampleX3dObject.handleArguments(args); if (validate) { System.out.print("Java program \"TargetShip\" self-validation test results: "); String validationResults = thisExampleX3dObject.validationReport(); System.out.println(validationResults); } } }