feat(vessels): draw vessels as shaded sprites seen from the camera's angle

Vessels on the map were flat, top-down hulls turned along their course,
drawn at one size at every range.

Each hull shape (the ten vessel kinds, a dredger and a pilot boat) is
now rendered in Blender into a view sheet like the aircraft's
(public/sprites/vessel-views.webp: 208 views a shape, 7.5 degrees apart
from straight above down to the horizon, 4096 x 2496, grey, 2.2 MB),
cut at the waterline. On a renderer with `viewSheets` the Vessels layer
draws a vessel as the view of its hull from where the eye is, with the
flat hull as the fallback while the sheet loads or if it cannot load.
A vessel keeps its kind's colour; aids to navigation keep their upright
buoy; a renderer without view sheets draws the flat hulls as before.

Every AIS ship type code 0-99 maps to a shape in the sheet
(`vesselShape`, vesselTypes.js), pinned by a test. Type text such as
"Search & Rescue" and "Anti Pollution" is now recognised, which also
gives those vessels their right kind colour.

Size: a vessel's icon now follows its range from the eye on the same
range aircraft icons use (1.5 times its former size up close, its
former size at about 1,000 km, a third from 8,000 km out), so it stays
under an aircraft's icon at every range, and the vessel set recedes
toward the horizon as the aircraft sets do.

Tools: the bake script handles both sheets
(scripts/bake-view-sheet.py; `npm run build:aircraft-views`,
`npm run build:vessel-views`), and refuses a partial bake over a shipped
sheet. scripts/qa-view-sheet.mjs writes contact sheets of a bake;
scripts/qa-aircraft-views.mjs takes `--layer vessels`. The aircraft
sheet is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Mazeyar Moeini FeizabadiandClaude Fable 5.2 committed 2026-11-23 04:10:58 +01:00
1 parent b4ff9b1e07
commit 01187cbe7a
19 files changed
+1115 -272

No files matched your search

+86
View File
@@ -0,0 +1,86 @@
{
"image": "vessel-views.webp",
"cellPx": 64,
"columns": 64,
"rows": 39,
"ringStepDeg": 7.5,
"rings": [
1,
4,
7,
10,
13,
16,
18,
20,
22,
23,
24,
25,
25
],
"fill": 0.92,
"grey": true,
"subjects": {
"cargo": {
"first": 0,
"model": "ships/container_ship.glb",
"radiusM": 160.913
},
"tanker": {
"first": 208,
"model": "ships/tanker.glb",
"radiusM": 130.314
},
"passenger": {
"first": 416,
"model": "ships/cruise_ship.glb",
"radiusM": 168.583
},
"highspeed": {
"first": 624,
"model": "ships/fast_ferry.glb",
"radiusM": 23.032
},
"fishing": {
"first": 832,
"model": "ships/trawler.glb",
"radiusM": 13.229
},
"tug": {
"first": 1040,
"model": "ships/tug.glb",
"radiusM": 16.418
},
"sailing": {
"first": 1248,
"model": "ships/sailboat.glb",
"radiusM": 8.358
},
"pleasure": {
"first": 1456,
"model": "ships/motor_yacht.glb",
"radiusM": 10.073
},
"military": {
"first": 1664,
"model": "ships/patrol.glb",
"radiusM": 36.28
},
"other": {
"first": 1872,
"model": "ships/generic_vessel.glb",
"radiusM": 21.828
},
"dredger": {
"first": 2080,
"model": "ships/dredger.glb",
"radiusM": 53.542
},
"pilot": {
"first": 2288,
"model": "ships/pilot_boat.glb",
"radiusM": 10.774
}
}
}