Prompt specification
Build or customize the Three.js 3D scene "Ports linked by seasonal sailing directions" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Ports linked by seasonal sailing directions
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/ports-linked-by-seasonal-sailing-directions-x2591
Scene Description Prompt:
Make a standalone HTML scene with Three.js from cdnjs that depicts a voxel teaching map of selected documented Indian Ocean trading ports. Use simplified coastal forms, small harbor buildings, and clear place labels rather than a dense world map. Provide two source-based seasonal wind overlays with arrows that remain distinct from the trade-route lines. Let the viewer select a season and follow a schematic voyage between ports, showing how its direction and schedule relate to the chosen wind pattern. Keep the represented historical period explicit. Mark the displayed voyages as illustrative routes unless a particular itinerary is documented, and preserve geographic separation instead of compressing unrelated coasts into one harbor scene.
Working Three.js Starter (ports-linked-by-seasonal-sailing-directions-x2591):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monsoon Ports — Indian Ocean, c. 1200–1500</title>
<style>
:root {
--ink: #17313a;
--muted: #5d7074;
--paper: #f5f0e4;
--paper-2: #eae1d0;
--line: #cfc4af;
--ocean: #103b47;
--coral: #ff705f;
--summer: #48dfca;
--winter: #ffc15a;
--route-context: #91aab0;
}
* { box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: var(--ocean);
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }
#stage {
position: absolute;
inset: 0 0 0 380px;
overflow: hidden;
background:
radial-gradient(circle at 50% 35%, rgba(66, 124, 133, .22), transparent 50%),
#0b3440;
}
#stage canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
touch-action: none;
}
#labels {
position: absolute;
inset: 0;
pointer-events: none;
overflow: hidden;
}
.panel {
position: absolute;
z-index: 10;
top: 16px;
bottom: 16px;
left: 16px;
width: 348px;
overflow-y: auto;
padding: 22px 20px 18px;
border: 1px solid rgba(255,255,255,.55);
border-radius: 20px;
background:
linear-gradient(145deg, rgba(255,255,255,.97), rgba(244,237,222,.97));
box-shadow: 0 20px 70px rgba(0,0,0,.28);
scrollbar-width: thin;
scrollbar-color: #b9ad98 transparent;
}
.eyebrow {
margin-bottom: 8px;
color: #88775d;
font-size: 10px;
font-weight: 800;
letter-spacing: .17em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 34px;
font-weight: 600;
line-height: .98;
letter-spacing: -.03em;
}
.intro {
margin: 13px 0 15px;
color: var(--muted);
font-size: 13px;
line-height: 1.55;
}
.period {
display: flex;
align-items: center;
gap: 9px;
margin-bottom: 18px;
padding: 10px 12px;
border: 1px solid #d7cab2;
border-radius: 11px;
background: #eee5d3;
color: #514534;
font-size: 12px;
font-weight: 750;
}
.period span:first-child {
padding: 4px 7px;
border-radius: 6px;
background: var(--ink);
color: #fff8ea;
font-size: 10px;
letter-spacing: .08em;
}
section {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid var(--line);
}
section:first-of-type { border-top: 0; }
h2 {
margin: 0 0 10px;
font-size: 11px;
font-weight: 850;
letter-spacing: .12em;
text-transform: uppercase;
}
.season-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.season-button {
min-height: 72px;
padding: 10px 8px;
border: 1px solid #cfc3ab;
border-radius: 12px;
background: rgba(255,255,255,.52);
cursor: pointer;
text-align: left;
transition: .18s ease;
}
.season-button:hover { transform: translateY(-1px); }
.season-button[aria-pressed="true"] {
border-color: var(--ink);
background: var(--ink);
color: #fffaf0;
box-shadow: 0 6px 18px rgba(23,49,58,.18);
}
.season-button strong {
display: block;
margin-bottom: 4px;
font-size: 12px;
}
.season-button small {
display: block;
opacity: .75;
font-size: 10px;
}
.route-card {
margin-top: 11px;
padding: 13px;
border: 1px solid #ddcdb5;
border-radius: 13px;
background: rgba(255,255,255,.55);
}
.illustrative {
display: inline-flex;
align-items: center;
gap: 6px;
margin-bottom: 9px;
color: #a24d42;
font-size: 9px;
font-weight: 900;
letter-spacing: .1em;
text-transform: uppercase;
}
.illustrative::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--coral);
}
#route-title {
margin: 0 0 4px;
font-family: Georgia, "Times New Roman", serif;
font-size: 21px;
font-weight: 600;
}
#route-summary {
margin: 0;
color: #607176;
font-size: 11px;
line-height: 1.5;
}
.schedule {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px;
margin-top: 11px;
}
.schedule > div {
padding: 8px;
border-radius: 9px;
background: #ede5d5;
}
.schedule span {
display: block;
margin-bottom: 3px;
color: #82735c;
font-size: 8px;
font-weight: 850;
letter-spacing: .1em;
text-transform: uppercase;
}
.schedule strong {
display: block;
font-size: 11px;
line-height: 1.35;
}
.voyage-controls {
display: flex;
gap: 7px;
margin-top: 10px;
}
.primary, .secondary {
min-height: 37px;
border-radius: 9px;
cursor: pointer;
font-size: 11px;
font-weight: 800;
}
.primary {
flex: 1;
border: 1px solid var(--ink);
background: var(--ink);
color: white;
}
.secondary {
padding: 0 11px;
border: 1px solid #cfc2aa;
background: rgba(255,255,255,.7);
}
.primary:hover, .secondary:hover { filter: brightness(1.05); }
.progress {
height: 5px;
margin-top: 11px;
overflow: hidden;
border-radius: 999px;
background: #ded3bf;
}
#progress-fill {
width: 0;
height: 100%;
border-radius: inherit;
background: var(--coral);
transition: width .1s linear;
}
.progress-meta {
display: flex;
justify-content: space-between;
margin-top: 6px;
color: #7b6e5a;
font-size: 9px;
}
.check-row {
display: flex;
align-items: center;
gap: 8px;
margin-top: 10px;
color: #4f6267;
font-size: 11px;
}
.check-row input {
accent-color: var(--ink);
}
.legend {
display: grid;
gap: 9px;
}
.legend-item {
display: grid;
grid-template-columns: 38px 1fr;
align-items: center;
gap: 9px;
color: #56696d;
font-size: 10px;
line-height: 1.35;
}
.legend-item strong {
display: block;
color: var(--ink);
font-size: 10px;
}
.legend-route {
height: 0;
border-top: 3px dashed var(--coral);
}
.legend-context {
height: 0;
border-top: 2px dotted var(--route-context);
}
.legend-wind {
position: relative;
height: 4px;
border-radius: 3px;
background: var(--summer);
}
.legend-wind::after {
content: "";
position: absolute;
right: -1px;
top: -5px;
width: 0;
height: 0;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-left: 11px solid var(--summer);
}
#port-name {
margin: 0 0 4px;
font-family: Georgia, "Times New Roman", serif;
font-size: 21px;
}
#port-place {
margin: 0 0 8px;
color: #8a775a;
font-size: 9px;
font-weight: 850;
letter-spacing: .1em;
text-transform: uppercase;
}
#port-description {
margin: 0;
color: #53666a;
font-size: 11px;
line-height: 1.55;
}
#port-coordinates {
margin-top: 8px;
color: #7b6e5a;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
}
details summary {
cursor: pointer;
color: var(--ink);
font-size: 11px;
font-weight: 850;
}
details p {
color: #5c6d70;
font-size: 10px;
line-height: 1.55;
}
details a {
color: #245e70;
text-underline-offset: 2px;
}
.source-list {
margin: 9px 0 0;
padding-left: 17px;
}
.source-list li { margin: 7px 0; }
.scope-note {
margin-top: 12px;
padding: 10px;
border-left: 3px solid #ba775d;
background: rgba(185,119,93,.08);
color: #6a5c50;
font-size: 9px;
line-height: 1.5;
}
.port-label {
position: absolute;
z-index: 5;
display: flex;
align-items: center;
gap: 6px;
padding: 5px 8px 5px 5px;
border: 1px solid rgba(255,255,255,.55);
border-radius: 8px;
background: rgba(9, 39, 47, .86);
box-shadow: 0 4px 16px rgba(0,0,0,.25);
color: #fff8e9;
cursor: pointer;
pointer-events: auto;
transform: translate(-50%, -115%);
white-space: nowrap;
backdrop-filter: blur(5px);
}
.port-label:hover,
.port-label.selected {
border-color: #ffd9a1;
background: rgba(18, 54, 62, .96);
}
.port-label .dot {
width: 10px;
height: 10px;
flex: 0 0 auto;
border: 2px solid #ffca7b;
border-radius: 2px;
background: #d37a55;
}
.port-label strong {
display: block;
font-size: 11px;
line-height: 1.05;
}
.port-label small {
display: block;
margin-top: 2px;
color: #bfd0d1;
font-size: 8px;
}
.region-label {
position: absolute;
color: rgba(193, 222, 221, .58);
font-family: Georgia, "Times New Roman", serif;
font-size: 12px;
font-style: italic;
letter-spacing: .08em;
transform: translate(-50%, -50%);
text-shadow: 0 1px 8px rgba(0,0,0,.35);
white-space: nowrap;
}
.route-label {
position: absolute;
z-index: 4;
padding: 5px 8px;
border: 1px solid rgba(255,112,95,.7);
border-radius: 999px;
background: rgba(24,42,47,.84);
color: #ffc2b9;
font-size: 8px;
font-weight: 850;
letter-spacing: .08em;
text-transform: uppercase;
transform: translate(-50%, -50%);
white-space: nowrap;
}
.map-badge {
position: absolute;
z-index: 8;
top: 15px;
right: 15px;
display: flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
border: 1px solid rgba(255,255,255,.18);
border-radius: 9px;
background: rgba(8,37,45,.76);
color: #d9e8e6;
font-size: 9px;
letter-spacing: .06em;
text-transform: uppercase;
backdrop-filter: blur(8px);
}
.map-badge b {
color: #ffd197;
font-size: 10px;
}
.map-tools {
position: absolute;
z-index: 8;
right: 15px;
bottom: 17px;
display: flex;
align-items: center;
gap: 5px;
}
.map-tools button {
width: 34px;
height: 34px;
border: 1px solid rgba(255,255,255,.2);
border-radius: 8px;
background: rgba(8,37,45,.78);
color: white;
cursor: pointer;
font-size: 17px;
backdrop-filter: blur(8px);
}
.map-tools button.wide {
width: auto;
padding: 0 10px;
font-size: 9px;
font-weight: 800;
letter-spacing: .08em;
text-transform: uppercase;
}
.north {
position: absolute;
z-index: 7;
right: 23px;
bottom: 64px;
width: 30px;
text-align: center;
color: #d7e7e4;
font-size: 9px;
font-weight: 900;
pointer-events: none;
}
.north-arrow {
width: 0;
height: 0;
margin: 4px auto 0;
border-right: 7px solid transparent;
border-bottom: 18px solid #f3c37c;
border-left: 7px solid transparent;
transform-origin: 50% 70%;
}
.map-hint {
position: absolute;
z-index: 7;
left: 16px;
bottom: 15px;
padding: 7px 9px;
border: 1px solid rgba(255,255,255,.12);
border-radius: 8px;
background: rgba(8,37,45,.68);
color: #b7cdcc;
font-size: 9px;
backdrop-filter: blur(7px);
pointer-events: none;
}
@media (max-width: 820px) {
#stage {
inset: 0 0 44% 0;
}
.panel {
top: auto;
right: 0;
bottom: 0;
left: 0;
width: auto;
max-height: 44%;
border-radius: 18px 18px 0 0;
}
h1 { font-size: 28px; }
.map-badge { top: 10px; right: 10px; }
.map-hint { display: none; }
}
</style>
</head>
<body>
<main id="stage" aria-label="Interactive voxel map of selected Indian Ocean trading ports">
<div id="labels"></div>
<div class="map-badge">
<b>c. 1200–1500 CE</b>
<span>Teaching reconstruction</span>
</div>
<div class="north" aria-hidden="true">
N
<div class="north-arrow" id="north-arrow"></div>
</div>
<div class="map-tools">
<button id="zoom-out" title="Zoom out" aria-label="Zoom out">−</button>
<button id="zoom-in" title="Zoom in" aria-label="Zoom in">+</button>
<button id="reset-view" class="wide" title="Reset camera">Reset map</button>
</div>
<div class="map-hint">Drag: orbit · Shift-drag: pan · Wheel: zoom · Click a port</div>
</main>
<aside class="panel">
<div class="eyebrow">Indian Ocean · Selected Ports</div>
<h1>Monsoon Ports</h1>
<p class="intro">
Compare a seasonal sailing direction with a schematic port-to-port voyage.
Coastlines are deliberately generalized and each port remains in its own
geographic setting.
</p>
<div class="period">
<span>1200–1500 CE</span>
<span>Historical period represented</span>
</div>
<section>
<h2>1 · Choose a seasonal layer</h2>
<div class="season-grid">
<button class="season-button" data-season="summer" aria-pressed="true">
<strong>Southwest monsoon</strong>
<small>Summer · June–September</small>
</button>
<button class="season-button" data-season="winter" aria-pressed="false">
<strong>Northeast monsoon</strong>
<small>Winter · November–February</small>
</button>
</div>
<div class="route-card">
<div class="illustrative">Illustrative composite</div>
<h3 id="route-title">Aden → Cambay</h3>
<p id="route-summary"></p>
<div class="schedule">
<div>
<span>Broad window</span>
<strong id="route-window"></strong>
</div>
<div>
<span>Wind relation</span>
<strong id="route-wind"></strong>
</div>
</div>
<div class="voyage-controls">
<button class="primary" id="play-route">Start voyage</button>
<button class="secondary" id="restart-route">Restart</button>
</div>
<div class="progress" aria-hidden="true">
<div id="progress-fill"></div>
</div>
<div class="progress-meta">
<span id="route-status">Ready</span>
<span id="route-percent">0%</span>
</div>
<label class="check-row">
<input type="checkbox" id="follow-ship">
Follow the vessel and keep the active route in view
</label>
</div>
</section>
<section>
<h2>2 · Read the map</h2>
<div class="legend">
<div class="legend-item">
<div class="legend-route"></div>
<div><strong>Active seasonal voyage</strong> Coral segmented line and vessel</div>
</div>
<div class="legend-item">
<div class="legend-context"></div>
<div><strong>Regional corridor context</strong> Quiet dotted links between selected ports</div>
</div>
<div class="legend-item">
<div class="legend-wind" id="legend-wind"></div>
<div><strong id="wind-legend-title">Southwesterly winds</strong> 3D arrows show flow toward the northeast</div>
</div>
</div>
</section>
<section>
<h2>Selected port</h2>
<h3 id="port-name">Aden</h3>
<div id="port-place">Yemen · western Indian Ocean</div>
<p id="port-description"></p>
<div id="port-coordinates"></div>
</section>
<section>
<details>
<summary>Sources & interpretation</summary>
<p>
The wind overlays follow the broad Indian Ocean seasonal reversal:
generally southwesterly flow in summer and northeasterly flow in winter.
They are teaching schematics, not dated ship-log reconstructions.
</p>
<ul class="source-list">
<li>
<a href="https://www.britannica.com/science/monsoon"
target="_blank" rel="noopener noreferrer">
Encyclopaedia Britannica, “Monsoon”
</a>
— basis for the summer southwesterly and winter northeasterly pattern.
</li>
<li>
<a href="https://www.ncei.noaa.gov/access/monsoon/"
target="_blank" rel="noopener noreferrer">
NOAA National Centers for Environmental Information, “Global Monsoon”
</a>
— seasonal circulation and regional reversal around South Asia and the Indian Ocean.
</li>
<li>
<a href="https://www.metmuseum.org/essays/the-indian-ocean-1200-1500"
target="_blank" rel="noopener noreferrer">
The Metropolitan Museum of Art, “The Indian Ocean, 1200–1500”
</a>
— historical context for Indian Ocean commerce and major entrepôts in this period.
</li>
<li>
<a href="https://www.worldhistory.org/Indian_Ocean_Trade_Routes/"
target="_blank" rel="noopener noreferrer">
World History Encyclopedia, “Indian Ocean Trade Routes”
</a>
— accessible overview of ports, commodities, and regional exchange networks.
</li>
</ul>
<p>
Port selection and wording are a synthetic teaching selection from documented
commercial centers. The lines do not represent modern borders.
</p>
</details>
<div class="scope-note">
<strong>Route status:</strong> every line in this scene is an illustrative
corridor or composite. The Aden–Cambay passage is not presented as a
documented ship itinerary. Seasonal windows are broad climatological
guidance, not exact departure or arrival dates.
</div>
</section>
</aside>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
/* --------------------------------------------------------------------------
Data and projection
-------------------------------------------------------------------------- */
const PORTS = [
{
id: "aden",
name: "Aden",
place: "Yemen",
lon: 45.02,
lat: 12.79,
type: "peninsula",
description:
"A major Yemeni entrepôt connecting Red Sea shipping with the western Indian Ocean. Its position made it a crucial transfer point throughout the period represented."
},
{
id: "hormuz",
name: "Hormuz",
place: "Iranian Persian Gulf",
lon: 56.45,
lat: 27.09,
type: "island",
description:
"An island port at the mouth of the Persian Gulf, linking Gulf traffic to Indian Ocean networks. Hormuz was an important commercial center from the medieval period into the sixteenth century."
},
{
id: "cambay",
name: "Cambay",
modern: "Khambhat",
place: "Gujarat, India",
lon: 72.62,
lat: 22.35,
type: "gulf",
description:
"Khambhat, the principal port of the Cambay estuary, connected western Indian production and overland routes with maritime commerce. It was prominent in thirteenth- to fifteenth-century trade."
},
{
id: "calicut",
name: "Calicut",
modern: "Kozhikode",
place: "Malabar coast, India",
lon: 75.78,
lat: 11.26,
type: "coast",
description:
"A Malabar port strongly associated with pepper commerce and wide-ranging exchange. Calicut became one of the best-known Indian Ocean entrepôts in the thirteenth to fifteenth centuries."
},
{
id: "malacca",
name: "Malacca",
place: "Malay Peninsula",
lon: 102.25,
lat: 2.20,
type: "estuary",
description:
"A strait entrepôt connecting Bay of Bengal and South China Sea traffic. Malacca rose rapidly during the fifteenth century and became central to long-distance maritime exchange."
}
];
const SEASONS = {
summer: {
name: "Southwest monsoon",
window: "June–September",
start: "aden",
end: "cambay",
title: "Aden → Cambay",
summary:
"A schematic Arabia-to-Gujarat crossing. The east- and northeast-bound direction has a favorable component in the broad southwesterly summer monsoon.",
wind: "SW flow aids NE heading",
windLegend: "Southwesterly winds",
windDirection: "toward the northeast",
arrowColor: 0x48dfca,
uiColor: "#48dfca",
vector: new THREE.Vector2(0.82, -0.57)
},
winter: {
name: "Northeast monsoon",
window: "November–February",
start: "cambay",
end: "aden",
title: "Cambay → Aden",
summary:
"A schematic Gujarat-to-Arabia return. The west- and southwest-bound direction has a favorable component in the broad northeasterly winter monsoon.",
wind: "NE flow aids SW heading",
windLegend: "Northeasterly winds",
windDirection: "toward the southwest",
arrowColor: 0xffc15a,
uiColor: "#ffc15a",
vector: new THREE.Vector2(-0.82, 0.57)
}
};
const SCALE = 2.55;
const portById = Object.fromEntries(PORTS.map(p => [p.id, p]));
function projectPort(port) {
const x = (port.lon - 40) * SCALE;
const z = (30 - port.lat) * SCALE;
return new THREE.Vector3(x, 0, z);
}
PORTS.forEach(p => {
p.world = projectPort(p);
});
const stage = document.querySelector("#stage");
const labelsLayer = document.querySelector("#labels");
/* --------------------------------------------------------------------------
Renderer, scene and camera
-------------------------------------------------------------------------- */
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0b3440);
scene.fog = new THREE.Fog(0x0b3440, 245, 430);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
stage.prepend(renderer.domElement);
const camera = new THREE.OrthographicCamera(-90, 90, 60, -60, 0.1, 700);
const initialTarget = new THREE.Vector3(84, 0, 38);
const cameraTarget = initialTarget.clone();
const cameraState = {
yaw: 0,
pitch: 1.08,
zoom: 1
};
let viewHeight = 110;
let viewWidth = 170;
function resize() {
const width = Math.max(1, stage.clientWidth);
const height = Math.max(1, stage.clientHeight);
const aspect = width / height;
renderer.setSize(width, height, false);
viewHeight = Math.max(94, 174 / aspect) / cameraState.zoom;
viewWidth = viewHeight * aspect;
camera.left = -viewWidth / 2;
camera.right = viewWidth / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
camera.updateProjectionMatrix();
}
function updateCamera() {
const distance = 300;
const yaw = cameraState.yaw;
const pitch = cameraState.pitch;
camera.position.set(
cameraTarget.x + Math.sin(yaw) * Math.cos(pitch) * distance,
cameraTarget.y + Math.sin(pitch) * distance,
cameraTarget.z + Math.cos(yaw) * Math.cos(pitch) * distance
);
camera.lookAt(cameraTarget);
camera.updateMatrixWorld();
}
new ResizeObserver(resize).observe(stage);
/* --------------------------------------------------------------------------
Lighting and ocean
-------------------------------------------------------------------------- */
scene.add(new THREE.HemisphereLight(0xc8eced, 0x3b3024, 2.0));
const sun = new THREE.DirectionalLight(0xffe0ad, 3.1);
sun.position.set(-45, 110, 55);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -120;
sun.shadow.camera.right = 120;
sun.shadow.camera.top = 90;
sun.shadow.camera.bottom = -90;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 260;
sun.shadow.bias = -0.0004;
scene.add(sun);
const ocean = new THREE.Mesh(
new THREE.PlaneGeometry(190, 100),
new THREE.MeshStandardMaterial({
color: 0x174d59,
roughness: 0.92,
metalness: 0.02
})
);
ocean.rotation.x = -Math.PI / 2;
ocean.position.set(84, -0.42, 36);
ocean.receiveShadow = true;
scene.add(ocean);
// A subtle raised ocean edge gives the teaching map the feel of a physical model.
const oceanBase = new THREE.Mesh(
new THREE.BoxGeometry(190, 1.3, 100),
new THREE.MeshStandardMaterial({ color: 0x082c35, roughness: 1 })
);
oceanBase.position.set(84, -1.04, 36);
scene.add(oceanBase);
/* --------------------------------------------------------------------------
Graticule
-------------------------------------------------------------------------- */
const graticulePoints = [];
for (let lon = 40; lon <= 110; lon += 10) {
const x = (lon - 40) * SCALE;
graticulePoints.push(
new THREE.Vector3(x, 0.03, -4),
new THREE.Vector3(x, 0.03, 80)
);
}
for (let lat = 0; lat <= 30; lat += 10) {
const z = (30 - lat) * SCALE;
graticulePoints.push(
new THREE.Vector3(-3, 0.03, z),
new THREE.Vector3(170, 0.03, z)
);
}
const graticule = new THREE.LineSegments(
new THREE.BufferGeometry().setFromPoints(graticulePoints),
new THREE.LineBasicMaterial({
color: 0x9bc6c6,
transparent: true,
opacity: 0.10,
depthWrite: false
})
);
scene.add(graticule);
/* --------------------------------------------------------------------------
Voxel ports
-------------------------------------------------------------------------- */
const landMaterials = [
new THREE.MeshStandardMaterial({ color: 0xc5a96e, roughness: 1 }),
new THREE.MeshStandardMaterial({ color: 0xd1b77a, roughness: 1 }),
new THREE.MeshStandardMaterial({ color: 0xb99d65, roughness: 1 })
];
const roofMaterial = new THREE.MeshStandardMaterial({
color: 0xa64e3d,
roughness: 0.9
});
const buildingMaterials = [
new THREE.MeshStandardMaterial({ color: 0xf0dfbd, roughness: 0.85 }),
new THREE.MeshStandardMaterial({ color: 0xe4cfa7, roughness: 0.9 }),
new THREE.MeshStandardMaterial({ color: 0xd5d7c2, roughness: 0.9 })
];
const quayMaterial = new THREE.MeshStandardMaterial({
color: 0x8d7960,
roughness: 0.95
});
const markerMaterial = new THREE.MeshStandardMaterial({
color: 0xffb75f,
emissive: 0x7d2c15,
emissiveIntensity: 0.35,
roughness: 0.65
});
const markerMeshes = [];
const portLabelElements = new Map();
function seededRandom(seed) {
let value = seed >>> 0;
return () => {
value = (value * 1664525 + 1013904223) >>> 0;
return value / 4294967296;
};
}
function landCellsFor(type) {
const cells = [];
const add = (gx, gz) => cells.push([gx, gz]);
if (type === "island") {
for (let gx = -2; gx <= 2; gx++) {
for (let gz = -1; gz <= 1; gz++) {
if (gx * gx * 0.7 + gz * gz <= 5.2) add(gx, gz);
}
}
} else if (type === "peninsula") {
for (let gx = -2; gx <= 2; gx++) {
for (let gz = -2; gz <= 2; gz++) {
if (gx >= 0 || gz <= -1) add(gx, gz);
}
}
} else if (type === "gulf") {
for (let gx = 0; gx <= 6; gx++) {
for (let gz = -3; gz <= 3; gz++) {
if (gx >= 1 && !(gx < 4 && gz === 0)) add(gx, gz);
}
}
} else if (type === "estuary") {
for (let gx = 0; gx <= 6; gx++) {
for (let gz = -3; gz <= 3; gz++) {
if (gx >= 1) add(gx, gz);
if (gx >= 2 && gx <= 5 && gz >= 2) add(gx, gz);
}
}
} else {
for (let gx = 0; gx <= 6; gx++) {
for (let gz = -3; gz <= 3; gz++) {
if (gx >= 1) add(gx, gz);
}
}
}
return cells;
}
function buildVoxelPort(port, index) {
const group = new THREE.Group();
group.position.copy(port.world);
const random = seededRandom(9137 + index * 977);
const cellSize = 1.35;
const cells = landCellsFor(port.type);
cells.forEach(([gx, gz], cellIndex) => {
const height = 0.7 + random() * 1.15;
const material = landMaterials[(cellIndex + index) % landMaterials.length];
const block = new THREE.Mesh(
new THREE.BoxGeometry(cellSize * 0.985, height, cellSize * 0.985),
material
);
block.position.set(gx * cellSize, height / 2 - 0.25, gz * cellSize);
block.castShadow = true;
block.receiveShadow = true;
group.add(block);
// Small warehouses and houses on selected land blocks.
const nearHarbor = Math.abs(gx - 1) + Math.abs(gz) < 2;
if (!nearHarbor && random() < 0.38) {
const bw = 0.48 + random() * 0.30;
const bd = 0.48 + random() * 0.30;
const bh = 0.45 + random() * 0.75;
const building = new THREE.Mesh(
new THREE.BoxGeometry(bw, bh, bd),
buildingMaterials[(cellIndex + index) % buildingMaterials.length]
);
building.position.set(
gx * cellSize + (random() - 0.5) * 0.18,
height - 0.25 + bh / 2,
gz * cellSize + (random() - 0.5) * 0.18
);
building.castShadow = true;
group.add(building);
if (random() > 0.42) {
const roof = new THREE.Mesh(
new THREE.BoxGeometry(bw * 1.08, 0.13, bd * 1.08),
roofMaterial
);
roof.position.set(
building.position.x,
height - 0.25 + bh + 0.065,
building.position.z
);
roof.castShadow = true;
group.add(roof);
}
}
});
// Harbor quay, extending from the water toward the first land blocks.
const quay = new THREE.Mesh(
new THREE.BoxGeometry(2.7, 0.36, 1.15),
quayMaterial
);
quay.position.set(0.35, 0.08, 0);
quay.castShadow = true;
quay.receiveShadow = true;
group.add(quay);
// A conspicuous customs warehouse beside the quay.
const warehouse = new THREE.Mesh(
new THREE.BoxGeometry(0.88, 0.8, 0.72),
buildingMaterials[0]
);
warehouse.position.set(1.62, 0.42, -0.74);
warehouse.castShadow = true;
group.add(warehouse);
const warehouseRoof = new THREE.Mesh(
new THREE.BoxGeometry(0.98, 0.15, 0.82),
roofMaterial
);
warehouseRoof.position.set(1.62, 0.895, -0.74);
warehouseRoof.castShadow = true;
group.add(warehouseRoof);
// Voxel beacon marking the port.
const beacon = new THREE.Mesh(
new THREE.BoxGeometry(0.43, 1.55, 0.43),
markerMaterial
);
beacon.position.set(-0.65, 1.0, 0);
beacon.castShadow = true;
beacon.userData.portId = port.id;
group.add(beacon);
markerMeshes.push(beacon);
const cap = new THREE.Mesh(
new THREE.BoxGeometry(0.62, 0.18, 0.62),
new THREE.MeshStandardMaterial({ color: 0xffd18a, roughness: 0.7 })
);
cap.position.set(-0.65, 1.84, 0);
cap.castShadow = true;
group.add(cap);
scene.add(group);
}
PORTS.forEach(buildVoxelPort);
/* --------------------------------------------------------------------------
Context route lines
-------------------------------------------------------------------------- */
const contextRouteGroup = new THREE.Group();
scene.add(contextRouteGroup);
const contextPairs = [
["aden", "hormuz"],
["hormuz", "cambay"],
["cambay", "calicut"],
["calicut", "malacca"]
];
contextPairs.forEach(([aId, bId]) => {
const a = portById[aId].world.clone().setY(0.18);
const b = portById[bId].world.clone().setY(0.18);
const geometry = new THREE.BufferGeometry().setFromPoints([a, b]);
const material = new THREE.LineDashedMaterial({
color: 0x91aab0,
dashSize: 0.65,
gapSize: 2.25,
transparent: true,
opacity: 0.34,
depthWrite: false
});
const line = new THREE.Line(geometry, material);
line.computeLineDistances();
contextRouteGroup.add(line);
});
/* --------------------------------------------------------------------------
Seasonal wind arrows
-------------------------------------------------------------------------- */
let windGroup = new THREE.Group();
scene.add(windGroup);
function createWindArrow(color) {
const arrow = new THREE.Group();
const material = new THREE.MeshStandardMaterial({
color,
emissive: color,
emissiveIntensity: 0.18,
roughness: 0.55,
metalness: 0.05
});
const shaft = new THREE.Mesh(
new THREE.BoxGeometry(2.8, 0.22, 0.48),
material
);
shaft.position.x = 0.8;
shaft.castShadow = true;
arrow.add(shaft);
const head = new THREE.Mesh(
new THREE.ConeGeometry(0.72, 1.45, 4),
material
);
head.rotation.z = -Math.PI / 2;
head.position.x = 2.75;
head.castShadow = true;
arrow.add(head);
const tail = new THREE.Mesh(
new THREE.BoxGeometry(0.18, 0.34, 0.64),
material
);
tail.position.x = -0.65;
arrow.add(tail);
return arrow;
}
function disposeGroup(group) {
group.traverse(object => {
if (object.geometry) object.geometry.dispose();
if (object.material) {
if (Array.isArray(object.material)) {
object.material.forEach(m => m.dispose());
} else {
object.material.dispose();
}
}
});
}
function buildWindOverlay(season) {
scene.remove(windGroup);
disposeGroup(windGroup);
windGroup = new THREE.Group();
scene.add(windGroup);
const positions = [
[15, 29], [26, 24], [39, 31], [53, 22], [65, 28],
[18, 42], [32, 39], [47, 42], [61, 39], [71, 36]
];
positions.forEach(([x, z], index) => {
const arrow = createWindArrow(season.arrowColor);
arrow.position.set(x, 0.85 + (index % 3) * 0.18, z);
const dx = season.vector.x;
const dz = season.vector.y;
arrow.rotation.y = -Math.atan2(dz, dx);
arrow.scale.setScalar(index % 3 === 0 ? 1.08 : 0.9);
windGroup.add(arrow);
});
}
/* --------------------------------------------------------------------------
Active route and vessel
-------------------------------------------------------------------------- */
let activeSeason = "summer";
let activeRouteGroup = new THREE.Group();
scene.add(activeRouteGroup);
let routeCurve;
let ship;
let voyageProgress = 0;
let voyagePlaying = false;
const voyageDuration = 18;
const shipHullMaterial = new THREE.MeshStandardMaterial({
color: 0x6c3e2c,
roughness: 0.85
});
const shipSailMaterial = new THREE.MeshStandardMaterial({
color: 0xf3dfb8,
roughness: 0.9,
side: THREE.DoubleSide
});
const shipAccentMaterial = new THREE.MeshStandardMaterial({
color: 0xd2694f,
roughness: 0.8
});
function createShip() {
const group = new THREE.Group();
const hull = new THREE.Mesh(
new THREE.BoxGeometry(2.8, 0.55, 1.05),
shipHullMaterial
);
hull.position.y = 0.32;
hull.castShadow = true;
group.add(hull);
const bow = new THREE.Mesh(
new THREE.BoxGeometry(0.65, 0.42, 0.78),
shipAccentMaterial
);
bow.position.set(1.55, 0.37, 0);
bow.castShadow = true;
group.add(bow);
const cabin = new THREE.Mesh(
new THREE.BoxGeometry(0.75, 0.55, 0.72),
shipAccentMaterial
);
cabin.position.set(-0.8, 0.86, 0);
cabin.castShadow = true;
group.add(cabin);
const mast = new THREE.Mesh(
new THREE.BoxGeometry(0.11, 2.3, 0.11),
shipHullMaterial
);
mast.position.set(0.25, 1.55, 0);
mast.castShadow = true;
group.add(mast);
const sail = new THREE.Mesh(
new THREE.BoxGeometry(1.75, 1.42, 0.07),
shipSailMaterial
);
sail.position.set(-0.3, 1.72, 0);
sail.rotation.z = -0.08;
sail.castShadow = true;
group.add(sail);
const flag = new THREE.Mesh(
new THREE.BoxGeometry(0.55, 0.23, 0.05),
shipAccentMaterial
);
flag.position.set(0.56, 2.66, 0);
group.add(flag);
return group;
}
function buildActiveRoute(seasonKey) {
scene.remove(activeRouteGroup);
disposeGroup(activeRouteGroup);
activeRouteGroup = new THREE.Group();
scene.add(activeRouteGroup);
const season = SEASONS[seasonKey];
const start = portById[season.start].world.clone().setY(0.55);
const end = portById[season.end].world.clone().setY(0.55);
const direction = end.clone().sub(start);
const perpendicular = new THREE.Vector3(-direction.z, 0, direction.x).normalize();
const bend = perpendicular.multiplyScalar(3.0);
const q1 = start.clone().lerp(end, 0.34).add(bend);
const q2 = start.clone().lerp(end, 0.68).add(bend);
routeCurve = new THREE.CatmullRomCurve3(
[start, q1, q2, end],
false,
"catmullrom",
0.25
);
const routeMaterial = new THREE.MeshStandardMaterial({
color: 0xff705f,
emissive: 0x6d1710,
emissiveIntensity: 0.22,
roughness: 0.65
});
// Segmented cylindrical pieces make the voyage line visibly different
// from the solid, three-dimensional wind arrows.
const segmentCount = 38;
const up = new THREE.Vector3(0, 1, 0);
for (let i = 0; i < segmentCount; i++) {
const t0 = i / segmentCount;
const t1 = (i + 0.67) / segmentCount;
const a = routeCurve.getPointAt(t0);
const b = routeCurve.getPointAt(t1);
const segmentVector = b.clone().sub(a);
const length = segmentVector.length();
const segment = new THREE.Mesh(
new THREE.CylinderGeometry(0.24, 0.24, length, 6),
routeMaterial
);
segment.position.copy(a).lerp(b, 0.5);
segment.quaternion.setFromUnitVectors(up, segmentVector.normalize());
segment.castShadow = true;
activeRouteGroup.add(segment);
}
// Small coral endpoint caps.
[start, end].forEach(point => {
const cap = new THREE.Mesh(
new THREE.CylinderGeometry(0.55, 0.55, 0.18, 12),
routeMaterial
);
cap.position.copy(point);
cap.position.y = 0.52;
activeRouteGroup.add(cap);
});
if (ship) {
scene.remove(ship);
}
ship = createShip();
ship.position.copy(routeCurve.getPointAt(0));
scene.add(ship);
voyageProgress = 0;
voyagePlaying = false;
updateVoyageUI();
}
function setShipProgress(value) {
voyageProgress = THREE.MathUtils.clamp(value, 0, 1);
const point = routeCurve.getPointAt(voyageProgress);
const tangent = routeCurve.getTangentAt(voyageProgress);
ship.position.copy(point);
ship.position.y = 0.45;
ship.rotation.y = -Math.atan2(tangent.z, tangent.x);
const percent = Math.round(voyageProgress * 100);
document.querySelector("#progress-fill").style.width = `${percent}%`;
document.querySelector("#route-percent").textContent = `${percent}%`;
}
/* --------------------------------------------------------------------------
Labels
-------------------------------------------------------------------------- */
function createPortLabel(port) {
const button = document.createElement("button");
button.className = "port-label";
button.type = "button";
button.setAttribute("aria-label", `Show information about ${port.name}`);
button.innerHTML = `
<span class="dot"></span>
<span>
<strong>${port.name}</strong>
<small>${port.place}</small>
</span>
`;
button.addEventListener("click", event => {
event.stopPropagation();
selectPort(port.id);
});
labelsLayer.appendChild(button);
portLabelElements.set(port.id, button);
}
PORTS.forEach(createPortLabel);
const REGIONS = [
{ name: "Persian Gulf", position: new THREE.Vector3(42, 0, -4) },
{ name: "Arabian Sea", position: new THREE.Vector3(48, 0, 34) },
{ name: "Indian Ocean", position: new THREE.Vector3(72, 0, 60) },
{ name: "Bay of Bengal", position: new THREE.Vector3(111, 0, 49) },
{ name: "South China Sea", position: new THREE.Vector3(145, 0, 69) }
];
const regionElements = REGIONS.map(region => {
const element = document.createElement("div");
element.className = "region-label";
element.textContent = region.name;
labelsLayer.appendChild(element);
return { ...region, element };
});
const routeLabel = document.createElement("div");
routeLabel.className = "route-label";
routeLabel.textContent = "Illustrative seasonal crossing";
labelsLayer.appendChild(routeLabel);
function positionElement(element, worldPosition, offsetY = 0) {
const projected = worldPosition.clone();
projected.y += offsetY;
projected.project(camera);
const visible =
projected.z > -1 && projected.z < 1 &&
projected.x > -1.15 && projected.x < 1.15 &&
projected.y > -1.15 && projected.y < 1.15;
element.style.display = visible ? "" : "none";
const x = (projected.x * 0.5 + 0.5) * stage.clientWidth;
const y = (-projected.y * 0.5 + 0.5) * stage.clientHeight;
element.style.left = `${x}px`;
element.style.top = `${y}px`;
}
function updateLabels() {
PORTS.forEach(port => {
positionElement(portLabelElements.get(port.id), port.world, 1.95);
});
regionElements.forEach(region => {
positionElement(region.element, region.position, 0.1);
});
if (routeCurve) {
positionElement(routeLabel, routeCurve.getPointAt(0.52), 1.8);
}
// Rotate the compass with the camera yaw.
const center = cameraTarget.clone().project(camera);
const north = cameraTarget.clone().add(new THREE.Vector3(0, 0, -10)).project(camera);
const dx = (north.x - center.x) * stage.clientWidth;
const dy = -(north.y - center.y) * stage.clientHeight;
const angle = Math.atan2(dy, dx) * 180 / Math.PI;
document.querySelector("#north-arrow").style.transform = `rotate(${angle + 90}deg)`;
}
/* --------------------------------------------------------------------------
Panel and interaction
-------------------------------------------------------------------------- */
function selectPort(id) {
const port = portById[id];
document.querySelector("#port-name").textContent =
port.modern ? `${port.name} · ${port.modern}` : port.name;
document.querySelector("#port-place").textContent = port.place;
document.querySelector("#port-description").textContent = port.description;
document.querySelector("#port-coordinates").textContent =
`${Math.abs(port.lat).toFixed(2)}°${port.lat >= 0 ? "N" : "S"} · ` +
`${Math.abs(port.lon).toFixed(2)}°${port.lon >= 0 ? "E" : "W"}`;
portLabelElements.forEach((element, portId) => {
element.classList.toggle("selected", portId === id);
});
}
function updateSeasonUI() {
const season = SEASONS[activeSeason];
document.querySelector("#route-title").textContent = season.title;
document.querySelector("#route-summary").textContent = season.summary;
document.querySelector("#route-window").textContent = season.window;
document.querySelector("#route-wind").textContent = season.wind;
document.querySelector("#wind-legend-title").textContent = season.windLegend;
document.querySelector("#legend-wind").style.setProperty("--summer", season.uiColor);
const windLegend = document.querySelector("#legend-wind");
windLegend.style.background = season.uiColor;
windLegend.style.setProperty("border-left-color", season.uiColor);
windLegend.style.setProperty("--summer", season.uiColor);
const legendAfter = document.createElement("style");
legendAfter.dataset.seasonLegend = "true";
legendAfter.textContent = `#legend-wind::after { border-left-color: ${season.uiColor}; }`;
document.querySelectorAll("style[data-season-legend]").forEach(s => s.remove());
document.head.appendChild(legendAfter);
}
function switchSeason(seasonKey) {
activeSeason = seasonKey;
document.querySelectorAll(".season-button").forEach(button => {
button.setAttribute(
"aria-pressed",
String(button.dataset.season === seasonKey)
);
});
buildWindOverlay(SEASONS[seasonKey]);
buildActiveRoute(seasonKey);
updateSeasonUI();
setShipProgress(0);
}
document.querySelectorAll(".season-button").forEach(button => {
button.addEventListener("click", () => switchSeason(button.dataset.season));
});
document.querySelector("#play-route").addEventListener("click", () => {
if (voyageProgress >= 1) {
voyageProgress = 0;
setShipProgress(0);
}
voyagePlaying = !voyagePlaying;
updateVoyageUI();
});
document.querySelector("#restart-route").addEventListener("click", () => {
voyageProgress = 0;
voyagePlaying = false;
setShipProgress(0);
updateVoyageUI();
});
function updateVoyageUI() {
const playButton = document.querySelector("#play-route");
const status = document.querySelector("#route-status");
playButton.textContent = voyagePlaying
? "Pause voyage"
: voyageProgress >= 1
? "Sail again"
: voyageProgress > 0
? "Resume voyage"
: "Start voyage";
status.textContent = voyagePlaying
? "Under sail"
: voyageProgress >= 1
? "Arrived"
: voyageProgress > 0
? "Paused"
: "Ready";
}
document.querySelector("#follow-ship").addEventListener("change", event => {
if (event.target.checked && ship) {
cameraTarget.copy(ship.position);
cameraState.zoom = Math.max(cameraState.zoom, 1.55);
}
});
/* --------------------------------------------------------------------------
Direct camera controls — no addons
-------------------------------------------------------------------------- */
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
let dragging = false;
let pointerButton = 0;
let startX = 0;
let startY = 0;
let lastX = 0;
let lastY = 0;
let movedDistance = 0;
renderer.domElement.addEventListener("pointerdown", event => {
dragging = true;
pointerButton = event.button;
startX = lastX = event.clientX;
startY = lastY = event.clientY;
movedDistance = 0;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", event => {
if (!dragging) return;
const dx = event.clientX - lastX;
const dy = event.clientY - lastY;
movedDistance += Math.abs(dx) + Math.abs(dy);
lastX = event.clientX;
lastY = event.clientY;
if (event.shiftKey || pointerButton === 2 || pointerButton === 1) {
const worldPerPixelX = viewWidth / stage.clientWidth;
const worldPerPixelY = viewHeight / stage.clientHeight;
const right = new THREE.Vector3(
Math.cos(cameraState.yaw),
0,
-Math.sin(cameraState.yaw)
);
const forward = new THREE.Vector3(
-Math.sin(cameraState.yaw),
0,
-Math.cos(cameraState.yaw)
);
cameraTarget.addScaledVector(right, -dx * worldPerPixelX);
cameraTarget.addScaledVector(forward, dy * worldPerPixelY);
} else {
cameraState.yaw -= dx * 0.005;
cameraState.pitch = THREE.MathUtils.clamp(
cameraState.pitch + dy * 0.004,
0.55,
1.42
);
}
});
renderer.domElement.addEventListener("pointerup", event => {
dragging = false;
if (movedDistance < 6 && event.button === 0) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const hits = raycaster.intersectObjects(markerMeshes, false);
if (hits.length) {
selectPort(hits[0].object.userData.portId);
}
}
});
renderer.domElement.addEventListener("pointercancel", () => {
dragging = false;
});
renderer.domElement.addEventListener("contextmenu", event => {
event.preventDefault();
});
renderer.domElement.addEventListener("wheel", event => {
event.preventDefault();
cameraState.zoom = THREE.MathUtils.clamp(
cameraState.zoom * Math.exp(-event.deltaY * 0.001),
0.65,
3.4
);
resize();
}, { passive: false });
function zoomBy(factor) {
cameraState.zoom = THREE.MathUtils.clamp(
cameraState.zoom * factor,
0.65,
3.4
);
resize();
}
document.querySelector("#zoom-in").addEventListener("click", () => zoomBy(1.18));
document.querySelector("#zoom-out").addEventListener("click", () => zoomBy(1 / 1.18));
document.querySelector("#reset-view").addEventListener("click", () => {
cameraTarget.copy(initialTarget);
cameraState.yaw = 0;
cameraState.pitch = 1.08;
cameraState.zoom = 1;
resize();
});
/* --------------------------------------------------------------------------
Animation
-------------------------------------------------------------------------- */
const clock = new THREE.Clock();
function animate() {
const delta = Math.min(clock.getDelta(), 0.05);
if (voyagePlaying) {
voyageProgress += delta / voyageDuration;
if (voyageProgress >= 1) {
voyageProgress = 1;
voyagePlaying = false;
updateVoyageUI();
}
setShipProgress(voyageProgress);
}
if (document.querySelector("#follow-ship").checked && ship) {
const desiredTarget = ship.position.clone();
desiredTarget.y = 0;
cameraTarget.lerp(desiredTarget, 1 - Math.exp(-delta * 2.8));
}
updateCamera();
updateLabels();
renderer.render(scene, camera);
}
resize();
selectPort("aden");
switchSeason("summer");
renderer.setAnimationLoop(animate);
</script>
</body>
</html>
```