package Savage.ShipsMilitary.LandingPlatformDockLPD; /* 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.fields.*; import org.web3d.x3d.jsail.Geometry3D.*; import org.web3d.x3d.jsail.Grouping.*; import org.web3d.x3d.jsail.Interpolation.*; import org.web3d.x3d.jsail.Navigation.*; import org.web3d.x3d.jsail.Networking.*; import org.web3d.x3d.jsail.PointingDeviceSensor.*; import org.web3d.x3d.jsail.Rendering.*; import org.web3d.x3d.jsail.Shape.*; import org.web3d.x3d.jsail.Texturing.*; import org.web3d.x3d.jsail.Time.*; // Javadoc annotations follow, see below for source. /** *

Simple Landing Platform Dock (LPD) amphibious landing ship.

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

meta tags   Document Metadata
title LPD.x3d
description Simple Landing Platform Dock (LPD) amphibious landing ship.
creator Mike Hunsberger
created 28 January 2001
modified 22 August 2018
identifier https://savage.nps.edu/Savage/ShipsMilitary/LandingPlatformDock-LPD/LPD.x3d
reference http://www.fas.org
reference Information also obtained from Jane's Online Fighting Ship catalog
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 Mike Hunsberger */ public class LPD { /** Default constructor to create this object. */ public LPD () { 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_0) .setHead(new headObject() .addMeta(new metaObject().setName(metaObject.NAME_TITLE ).setContent("LPD.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_DESCRIPTION).setContent("Simple Landing Platform Dock (LPD) amphibious landing ship.")) .addMeta(new metaObject().setName(metaObject.NAME_CREATOR ).setContent("Mike Hunsberger")) .addMeta(new metaObject().setName(metaObject.NAME_CREATED ).setContent("28 January 2001")) .addMeta(new metaObject().setName(metaObject.NAME_MODIFIED ).setContent("22 August 2018")) .addMeta(new metaObject().setName(metaObject.NAME_IDENTIFIER ).setContent("https://savage.nps.edu/Savage/ShipsMilitary/LandingPlatformDock-LPD/LPD.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://www.fas.org")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("Information also obtained from Jane's Online Fighting Ship catalog")) .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().setDescription("LPD: Landing Platform Dock").setOrientation(1.0f,0.0f,0.0f,-0.2f).setPosition(-20.0f,40.0f,200.0f)) .addChild(new NavigationInfoObject().setSpeed(50f)) .addChild(new LODObject().setRange(new float[] {1000.0f,4000.0f,20000.0f}) .addComments(" Close range is high resolution. Need to check scale. ") .addChild(new GroupObject("LPD") .addChild(new TransformObject("Hull") .addChild(new ShapeObject() .setGeometry(new ExtrusionObject("UpperForward").setCreaseAngle(1.57f).setCrossSection(new MFVec2fObject(new float[] {0.0f,-16.0f,0.0f,16.0f,8.1f,16.0f,8.1f,-16.0f,0.0f,-16.0f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,0.0f,1.0f,-0.4f})).setScale(new MFVec2fObject(new float[] {1.0f,1.0f,1.5f,0.90f,1.5f,.75f,1.5f,.43f,1.5f,.1f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-10.5f,0.0f,0.0f,34.0f,4.0f,0.0f,53.7f,4.0f,0.0f,72.0f,4.0f,0.0f,80.0f,4.25f,0.0f}))) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject("HullGray").setDiffuseColor(0.5f,0.5f,0.5f)))) .addChild(new ShapeObject() .setGeometry(new ExtrusionObject("LowerAft").setCreaseAngle(1.57f).setCrossSection(new MFVec2fObject(new float[] {0.0f,-16.0f,0.0f,-13.0f,7.0f,-13.0f,7.0f,13.0f,0.0f,13.0f,0.0f,16.0f,7.0f,16.0f,8.0f,14.0f,8.0f,-14.0f,7.0f,-16.0f,0.0f,-16.0f})).setOrientation(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-117.0f,-8.0f,0.0f,0.0f,-8.0f,0.0f,1.0f,-8.0f,0.0f}))) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setUSE("HullGray")))) .addChild(new ShapeObject() .setGeometry(new ExtrusionObject("LowerForward").setCreaseAngle(1.57f).setCrossSection(new MFVec2fObject(new float[] {0.0f,-16.0f,0.0f,16.0f,7.0f,16.0f,8.0f,14.0f,8.0f,-14.0f,7.0f,-16.0f,0.0f,-16.0f})).setOrientation(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.3f})).setScale(new MFVec2fObject(new float[] {1.0f,1.0f,1.0f,.75f,1.0f,.43f,1.0f,.2f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {1.0f,-8.0f,0.0f,53.7f,-8.0f,0.0f,70.0f,-8.0f,0.0f,74.0f,-7.5f,0.0f}))) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setUSE("HullGray")))) .addChild(new ShapeObject() .setGeometry(new ExtrusionObject("UpperAft").setConvex(false).setCreaseAngle(1.57f).setCrossSection(new MFVec2fObject(new float[] {0.0f,-16.0f,8.1f,-16.0f,8.1f,-13.0f,1.0f,-13.0f,1.0f,13.0f,8.1f,13.0f,8.1f,16.0f,0.0f,16.0f,0.0f,-16.0f})).setOrientation(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,0.35f,0.0f,1.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f})).setSolid(false).setSpine(new MFVec3fObject(new float[] {-120.0f,0.0f,0.0f,-117.0f,0.0f,0.0f,-10.0f,0.0f,0.0f}))) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setUSE("HullGray")))) .addChild(new GroupObject("LowerDoorWithOpenTouchSensor") .addChild(new TouchSensorObject("OpenDoors").setDescription("Open Doors")) .addChild(new OrientationInterpolatorObject("LowerDoorOrientationInterpolator").setKey(new float[] {0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f}).setKeyValue(new MFRotationObject(new float[] {0.0f,0.0f,-1.0f,3.14f,0.0f,0.0f,-1.0f,2.95f,0.0f,0.0f,-1.0f,2.76f,0.0f,0.0f,-1.0f,2.56f,0.0f,0.0f,-1.0f,2.36f,0.0f,0.0f,-1.0f,2.16f,0.0f,0.0f,-1.0f,1.96f,0.0f,0.0f,-1.0f,1.76f,0.0f,0.0f,-1.0f,1.56f,0.0f,0.0f,-1.0f,1.36f,0.0f,0.0f,-1.0f,1.16f}))) .addChild(new TimeSensorObject("Clock2").setCycleInterval(10)) .addChild(new ROUTEObject().setFromNode("OpenDoors").setFromField("touchTime").setToNode("Clock2").setToField("set_startTime")) .addChild(new ROUTEObject().setFromNode("Clock2").setFromField("fraction_changed").setToNode("LowerDoorOrientationInterpolator").setToField("set_fraction")) .addChild(new TransformObject("LowerWellDeckDoor") .addChild(new TransformObject("lowerDoor").setCenter(0.0f,3.8f,0.0f).setRotation(0.0f,0.0f,-1.0f,3.14f).setTranslation(-116.0f,-19.0f,0.0f) .addChild(new ShapeObject() .setGeometry(new BoxObject().setSize(0.25f,7.6f,26.0f)) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.66f,1.0f)))))) .addChild(new ROUTEObject().setFromNode("LowerDoorOrientationInterpolator").setFromField("value_changed").setToNode("lowerDoor").setToField("set_rotation"))) .addChild(new GroupObject("UpperDoorWithCloseTouchSensor") .addChild(new OrientationInterpolatorObject("DoorOrientationInterpolator").setKey(new float[] {0.0f,0.1f,0.15f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f}).setKeyValue(new MFRotationObject(new float[] {0.0f,0.0f,1.0f,0.35f,0.0f,0.0f,-1.0f,0.26f,0.0f,0.0f,-1.0f,0.44f,0.0f,0.0f,-1.0f,0.52f,0.0f,0.0f,-1.0f,0.61f,0.0f,0.0f,-1.0f,0.70f,0.0f,0.0f,-1.0f,0.79f,0.0f,0.0f,-1.0f,0.87f,0.0f,0.0f,-1.0f,0.96f,0.0f,0.0f,-1.0f,1.10f,0.0f,0.0f,-1.0f,1.32f,0.0f,0.0f,-1.0f,1.45f}))) .addChild(new TimeSensorObject("Clock").setCycleInterval(10)) .addChild(new ROUTEObject().setFromNode("OpenDoors").setFromField("touchTime").setToNode("Clock").setToField("set_startTime")) .addChild(new ROUTEObject().setFromNode("Clock").setFromField("fraction_changed").setToNode("DoorOrientationInterpolator").setToField("set_fraction")) .addChild(new TransformObject("UpperWellDeckDoor") .addChild(new TransformObject("UpperDoor").setCenter(0.0f,4.0f,0.0f).setRotation(0.0f,0.0f,1.0f,0.35f).setTranslation(-119.0f,-4.3f,0.0f) .addChild(new ShapeObject() .setGeometry(new BoxObject().setSize(0.25f,8.0f,26.0f)) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.66f,1.0f)))))) .addChild(new ROUTEObject().setFromNode("DoorOrientationInterpolator").setFromField("value_changed").setToNode("UpperDoor").setToField("set_rotation")))) .addChild(new TransformObject("Superstructure") .addChild(new InlineObject().setUrl(new String[] {"LPDSuperstructure.x3d","https://savage.nps.edu/Savage/ShipsMilitary/LandingPlatformDock-LPD/LPDSuperstructure.x3d","LPDSuperstructure.wrl","https://savage.nps.edu/Savage/ShipsMilitary/LandingPlatformDock-LPD/LPDSuperstructure.wrl"})))) .addComments(" Medium range is low resolution ") .addChild(new GroupObject("LPDSimple") .addChild(new TransformObject() .addChild(new ShapeObject() .setGeometry(new BoxObject().setSize(208.5f,27.5f,31.9f)) .setAppearance(new AppearanceObject() .setMaterial(new MaterialObject().setDiffuseColor(0.65f,0.65f,0.65f)))))) .addComments(" Long range is tactical symbol ") .addChild(new GroupObject("LPDSymbol") .addChild(new BillboardObject().setAxisOfRotation(0.0f,0.0f,0.0f) .addChild(new TransformObject() .addChild(new ShapeObject() .setGeometry(new IndexedFaceSetObject().setCcw(false).setCoordIndex(new int[] {0,1,2,3,4,-1}) .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {100.0f,100.0f,0.0f,100.0f,-100.0f,0.0f,-100.0f,-100.0f,0.0f,-100.0f,100.0f,0.0f,100.0f,100.0f,0.0f})))) .setAppearance(new AppearanceObject() .setTexture(new ImageTextureObject().setUrl(new String[] {"LPDSymbol.png","https://savage.nps.edu/Savage/ShipsMilitary/LandingPlatformDock-LPD/LPDSymbol.png"}))))))) .addComments(" Extreme range is not rendered ") .addChild(new WorldInfoObject().setInfo(new String[] {"null node"})))); } // 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 LPD 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 LPD().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: \"LPD\" 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 \"LPD\" self-validation test results: "); String validationResults = thisExampleX3dObject.validationReport(); System.out.println(validationResults); } } }