added 3d model for ship with length 2

This commit is contained in:
Johannes Schmelz 2024-10-06 18:21:40 +02:00
parent 9f90d92198
commit b2a6f86fc2
7 changed files with 203132 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import pp.battleship.model.Shot;
import static java.util.Objects.requireNonNull;
import static pp.util.FloatMath.HALF_PI;
import static pp.util.FloatMath.PI;
import static pp.util.FloatMath.QUARTER_PI;
/**
* The {@code SeaSynchronizer} class is responsible for synchronizing the graphical
@ -37,6 +38,7 @@ class SeaSynchronizer extends ShipMapSynchronizer {
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
private static final String BOAT_SMALL_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o"; //NON-NLS
private static final String CV_MODEL = "Models/CV/CV.j3o"; //NON-NLS
private static final String BATTLE_MODEL = "Models/Battle/Battle.j3o"; //NON-NLS
private static final String COLOR = "Color"; //NON-NLS
private static final String SHIP = "ship"; //NON-NLS
private static final String SHOT = "shot"; //NON-NLS
@ -150,6 +152,9 @@ class SeaSynchronizer extends ShipMapSynchronizer {
case 3:
return createCV(ship);
case 2:
return createBattle(ship);
case 1:
return createSmallship(ship);
@ -232,6 +237,17 @@ class SeaSynchronizer extends ShipMapSynchronizer {
return model;
}
private Spatial createBattle(Battleship ship) {
final Spatial model = app.getAssetManager().loadModel(BATTLE_MODEL);
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
// model.move(0f, -0.05f, 0f);
model.scale(0.27f);
model.setShadowMode(ShadowMode.CastAndReceive);
return model;
}
/**
* Calculates the rotation angle for the specified rotation.
*

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

@ -43,7 +43,7 @@ public class ModelExporter extends SimpleApplication {
public void simpleInitApp() {
export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS
export("Models/BoatSmall/12219_boat_v2_L2.obj", "BoatSmall.j3o"); //NON-NLS
// export("Models/Cruiser/Cruiser 2012.obj", "Cruiser.j3o"); //NON-NLS
export("Models/Battle/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "Battle.j3o"); //NON-NLS
export("Models/CV/essex_scb-125_generic.obj", "CV.j3o"); //NON-NLS
stop();

View File

@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 29.03.2012 14:25:39
newmtl default
Ns 35.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 1.0000 1.0000 1.0000
Kd 1.0000 1.0000 1.0000
Ks 0.5400 0.5400 0.5400
Ke 0.0000 0.0000 0.0000
map_Ka 14084_WWII_ship_German_Type_II_U-boat_diff.jpg
map_Kd 14084_WWII_ship_German_Type_II_U-boat_diff.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB