Prompt specification
Build or customize the Three.js 3D scene "Compare change detection with different revisit intervals" 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: Compare change detection with different revisit intervals
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/compare-change-detection-with-different-revisit-interv-x2492
Scene Description Prompt:
Change satellite revisit intervals over a fictional low-poly landscape, showing missed brief events separately from spatial-resolution limits. Three.js from cdnjs, one HTML file.
Working Three.js Starter (compare-change-detection-with-different-revisit-interv-x2492):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Revisit Lab — Satellite Event Detection</title>
<style>
:root {
--bg: #071118;
--panel: rgba(9, 20, 28, 0.88);
--panel-solid: #0b1a23;
--border: rgba(183, 218, 226, 0.14);
--text: #edf7f6;
--muted: #91a8af;
--cyan: #65d9e7;
--green: #65e4ae;
--orange: #ffad67;
--violet: #bb91ff;
--coral: #ff7892;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: var(--bg);
color: var(--text);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button,
input {
font: inherit;
}
button {
color: inherit;
}
#scene {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
display: block;
outline: none;
touch-action: none;
}
#vignette {
position: fixed;
inset: 0;
pointer-events: none;
background:
radial-gradient(circle at 50% 45%, transparent 40%, rgba(1, 7, 11, 0.42) 100%),
linear-gradient(180deg, rgba(2, 9, 13, 0.28), transparent 28%, transparent 72%, rgba(2, 8, 12, 0.5));
z-index: 2;
}
#labels {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 4;
overflow: hidden;
}
.topbar {
position: fixed;
top: 18px;
left: 22px;
right: 22px;
height: 58px;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
pointer-events: none;
}
.brand {
display: flex;
align-items: center;
gap: 13px;
}
.brand-icon {
position: relative;
width: 39px;
height: 39px;
border: 1px solid rgba(101, 217, 231, 0.55);
border-radius: 50%;
box-shadow: 0 0 28px rgba(101, 217, 231, 0.12);
}
.brand-icon::before,
.brand-icon::after {
content: "";
position: absolute;
inset: 8px;
border: 1px solid rgba(101, 217, 231, 0.55);
border-radius: 50%;
}
.brand-icon::after {
inset: 17px;
background: var(--cyan);
border: 0;
box-shadow: 0 0 12px var(--cyan);
}
.eyebrow {
color: var(--cyan);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.19em;
text-transform: uppercase;
}
.brand h1 {
margin: 3px 0 0;
font-size: 20px;
line-height: 1;
letter-spacing: -0.025em;
font-weight: 720;
}
.brand h1 span {
color: var(--muted);
font-weight: 450;
}
.clock-block {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 13px;
border: 1px solid var(--border);
border-radius: 9px;
background: rgba(7, 17, 24, 0.66);
backdrop-filter: blur(12px);
}
#simClock {
min-width: 72px;
font-size: 20px;
font-weight: 650;
font-variant-numeric: tabular-nums;
letter-spacing: 0.04em;
}
.clock-label {
color: var(--muted);
font-size: 9px;
line-height: 1.35;
font-weight: 750;
letter-spacing: 0.13em;
}
.panel {
position: fixed;
z-index: 10;
border: 1px solid var(--border);
border-radius: 13px;
background: var(--panel);
backdrop-filter: blur(18px) saturate(1.15);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}
.controls {
top: 91px;
left: 22px;
width: 286px;
padding: 18px;
}
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.section-heading h2 {
margin: 0;
font-size: 11px;
font-weight: 800;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.section-heading span {
color: var(--muted);
font-size: 9px;
letter-spacing: 0.08em;
}
.control-block {
padding: 15px 0;
border-top: 1px solid rgba(183, 218, 226, 0.1);
}
.control-label {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.control-label label {
color: #bdd0d4;
font-size: 10px;
font-weight: 760;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.control-value {
color: var(--text);
font-size: 21px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.control-value small {
color: var(--muted);
font-size: 10px;
font-weight: 700;
letter-spacing: 0.08em;
}
.control-description {
margin: 8px 0 0;
color: var(--muted);
font-size: 11px;
line-height: 1.45;
}
input[type="range"] {
width: 100%;
height: 4px;
margin: 5px 0;
appearance: none;
border-radius: 99px;
background: linear-gradient(90deg, var(--cyan) var(--range-fill, 33%), rgba(155, 192, 201, 0.16) var(--range-fill, 33%));
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
width: 15px;
height: 15px;
appearance: none;
border: 3px solid #0b1b24;
border-radius: 50%;
background: var(--cyan);
box-shadow: 0 0 0 1px var(--cyan), 0 0 14px rgba(101, 217, 231, 0.35);
}
input[type="range"]::-moz-range-thumb {
width: 11px;
height: 11px;
border: 3px solid #0b1b24;
border-radius: 50%;
background: var(--cyan);
box-shadow: 0 0 0 1px var(--cyan);
}
.range-scale {
display: flex;
justify-content: space-between;
color: #6f8991;
margin-top: 8px;
font-size: 9px;
font-weight: 700;
letter-spacing: 0.05em;
}
.presets {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
margin-top: 12px;
}
.preset,
.filter-button,
.icon-button {
border: 1px solid rgba(181, 216, 224, 0.15);
background: rgba(160, 195, 204, 0.05);
color: var(--muted);
border-radius: 7px;
cursor: pointer;
transition: 140ms ease;
}
.preset {
padding: 7px 4px;
font-size: 10px;
font-weight: 720;
}
.preset:hover,
.preset.active,
.filter-button:hover,
.filter-button.active {
color: #e9ffff;
border-color: rgba(101, 217, 231, 0.55);
background: rgba(101, 217, 231, 0.11);
}
.explanation {
margin: 15px 0 2px;
padding: 11px 12px;
border: 1px solid rgba(101, 217, 231, 0.14);
border-radius: 8px;
background: rgba(101, 217, 231, 0.055);
color: #abc2c8;
font-size: 10.5px;
line-height: 1.55;
}
.explanation strong {
color: var(--cyan);
font-weight: 700;
}
.toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
color: #c1d0d4;
font-size: 11px;
}
.switch {
position: relative;
width: 31px;
height: 17px;
}
.switch input {
position: absolute;
opacity: 0;
}
.switch span {
position: absolute;
inset: 0;
border-radius: 20px;
background: rgba(156, 190, 198, 0.18);
transition: 160ms ease;
cursor: pointer;
}
.switch span::after {
content: "";
position: absolute;
top: 3px;
left: 3px;
width: 11px;
height: 11px;
border-radius: 50%;
background: #8fa8ae;
transition: 160ms ease;
}
.switch input:checked + span {
background: rgba(101, 217, 231, 0.3);
}
.switch input:checked + span::after {
left: 17px;
background: var(--cyan);
box-shadow: 0 0 9px rgba(101, 217, 231, 0.55);
}
.legend {
display: grid;
gap: 9px;
margin-top: 10px;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
color: #aebfc4;
font-size: 10px;
}
.legend-dot {
width: 8px;
height: 8px;
flex: 0 0 auto;
border-radius: 50%;
box-shadow: 0 0 9px currentColor;
}
.analysis {
top: 91px;
right: 22px;
bottom: 142px;
width: 358px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.analysis-head {
padding: 17px 17px 13px;
border-bottom: 1px solid var(--border);
}
.analysis-head .section-heading {
margin-bottom: 8px;
}
.live-dot {
display: inline-block;
width: 6px;
height: 6px;
margin-right: 6px;
border-radius: 50%;
background: var(--green);
box-shadow: 0 0 8px var(--green);
}
.metrics {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 7px;
}
.metric {
min-width: 0;
padding: 11px 9px;
border: 1px solid rgba(184, 216, 224, 0.1);
border-radius: 9px;
background: rgba(255, 255, 255, 0.025);
}
.metric span {
display: block;
color: var(--muted);
font-size: 8px;
line-height: 1.25;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.metric strong {
display: block;
margin: 4px 0 2px;
font-size: 25px;
line-height: 1;
font-variant-numeric: tabular-nums;
}
.metric small {
display: block;
color: #6f8991;
font-size: 8px;
line-height: 1.35;
}
.metric.green strong { color: var(--green); }
.metric.orange strong { color: var(--orange); }
.metric.violet strong { color: var(--violet); }
#coverageNote {
margin: 10px 0 0;
color: #839ca3;
font-size: 9.5px;
line-height: 1.45;
}
.selected-card {
margin: 12px 12px 0;
padding: 13px;
border: 1px solid rgba(183, 218, 226, 0.13);
border-radius: 9px;
background: rgba(255, 255, 255, 0.026);
}
.selected-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 10px;
}
.selected-code {
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.11em;
}
.selected-card h3 {
margin: 4px 0 0;
font-size: 14px;
font-weight: 670;
}
.status-pill {
flex: 0 0 auto;
padding: 5px 7px;
border: 1px solid currentColor;
border-radius: 99px;
font-size: 8px;
font-weight: 800;
letter-spacing: 0.07em;
text-transform: uppercase;
background: color-mix(in srgb, currentColor 10%, transparent);
}
.status-pill.captured { color: var(--green); }
.status-pill.temporal { color: var(--orange); }
.status-pill.spatial { color: var(--violet); }
.status-pill.both { color: var(--coral); }
.event-meta {
display: flex;
flex-wrap: wrap;
gap: 5px 10px;
margin: 10px 0;
color: #819aa1;
font-size: 9px;
font-variant-numeric: tabular-nums;
}
.reason-block {
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid rgba(183, 218, 226, 0.09);
color: #b8c8cc;
font-size: 10px;
line-height: 1.48;
}
.reason-block strong {
display: block;
margin-bottom: 3px;
font-size: 9px;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.reason-block.timing strong { color: var(--orange); }
.reason-block.space strong { color: var(--violet); }
.reason-block.good strong { color: var(--green); }
.event-section {
min-height: 0;
flex: 1;
display: flex;
flex-direction: column;
margin-top: 12px;
border-top: 1px solid var(--border);
}
.event-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 11px 13px 9px;
}
.event-toolbar > span {
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.12em;
}
.filters {
display: flex;
gap: 4px;
}
.filter-button {
padding: 4px 6px;
font-size: 8px;
font-weight: 750;
}
#eventList {
min-height: 0;
overflow-y: auto;
padding: 0 8px 10px;
scrollbar-width: thin;
scrollbar-color: rgba(101, 217, 231, 0.22) transparent;
}
.event-row {
width: 100%;
display: grid;
grid-template-columns: 8px minmax(0, 1fr) auto;
align-items: center;
gap: 9px;
padding: 9px 7px;
border: 0;
border-bottom: 1px solid rgba(183, 218, 226, 0.07);
background: transparent;
text-align: left;
cursor: pointer;
border-radius: 5px;
}
.event-row:hover,
.event-row.selected {
background: rgba(101, 217, 231, 0.055);
}
.event-row-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--event-color);
box-shadow: 0 0 8px var(--event-color);
}
.event-row-name {
min-width: 0;
font-size: 10px;
font-weight: 650;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.event-row-name small {
display: block;
margin-top: 2px;
color: #718b92;
font-size: 8.5px;
font-weight: 500;
}
.event-row-time {
color: #8ea5ab;
font-size: 9px;
font-variant-numeric: tabular-nums;
}
.timeline-panel {
position: fixed;
left: 22px;
right: 22px;
bottom: 20px;
z-index: 10;
height: 108px;
padding: 11px 14px 9px;
}
.timeline-toolbar {
height: 28px;
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 3px;
}
.play-button {
width: 28px;
height: 27px;
display: grid;
place-items: center;
border: 1px solid rgba(101, 217, 231, 0.34);
border-radius: 7px;
background: rgba(101, 217, 231, 0.11);
color: var(--cyan);
cursor: pointer;
font-size: 11px;
}
.timeline-title {
min-width: 145px;
font-size: 9px;
font-weight: 800;
letter-spacing: 0.1em;
text-transform: uppercase;
}
#sceneStatus {
color: var(--muted);
font-size: 9px;
letter-spacing: 0.04em;
}
.timeline-legend {
margin-left: auto;
display: flex;
gap: 14px;
color: #8ea5ab;
font-size: 8.5px;
}
.timeline-legend span {
display: flex;
align-items: center;
gap: 5px;
}
.timeline-legend i {
width: 7px;
height: 7px;
border-radius: 2px;
background: var(--legend-color);
}
#timelineSvg {
position: relative;
width: 100%;
height: 62px;
cursor: crosshair;
overflow: hidden;
border-top: 1px solid rgba(183, 218, 226, 0.1);
}
#timelineSvg svg {
width: 100%;
height: 100%;
display: block;
}
#hourTicks {
position: absolute;
inset: auto 0 0;
height: 12px;
pointer-events: none;
}
.hour-tick {
position: absolute;
top: 0;
color: #607b83;
font-size: 7.5px;
transform: translateX(-50%);
}
.event-marker {
position: absolute;
left: 0;
top: 0;
width: 13px;
height: 13px;
padding: 0;
border: 2px solid var(--event-color);
border-radius: 50%;
background: #0a171d;
box-shadow:
0 0 0 3px color-mix(in srgb, var(--event-color) 13%, transparent),
0 0 14px color-mix(in srgb, var(--event-color) 55%, transparent);
transform: translate(-50%, -50%);
cursor: pointer;
pointer-events: auto;
transition: width 140ms, height 140ms, box-shadow 140ms;
}
.event-marker::after {
content: attr(data-label);
position: absolute;
left: 17px;
top: 50%;
transform: translateY(-50%);
padding: 3px 6px;
border: 1px solid color-mix(in srgb, var(--event-color) 34%, transparent);
border-radius: 4px;
background: rgba(6, 16, 22, 0.86);
color: var(--event-color);
font-size: 7px;
font-weight: 800;
letter-spacing: 0.07em;
white-space: nowrap;
opacity: 0;
transition: opacity 140ms;
}
.event-marker:hover,
.event-marker.selected {
width: 16px;
height: 16px;
box-shadow:
0 0 0 4px color-mix(in srgb, var(--event-color) 17%, transparent),
0 0 20px color-mix(in srgb, var(--event-color) 70%, transparent);
}
.event-marker:hover::after,
.event-marker.selected::after {
opacity: 1;
}
.place-label {
position: absolute;
left: 0;
top: 0;
color: rgba(214, 235, 232, 0.48);
font-size: 8px;
font-weight: 750;
letter-spacing: 0.17em;
white-space: nowrap;
transform: translate(-50%, -50%);
text-shadow: 0 1px 6px #000;
}
.place-label::before {
content: "";
display: inline-block;
width: 3px;
height: 3px;
margin: 0 5px 2px 0;
border-radius: 50%;
background: currentColor;
}
.map-hint {
position: fixed;
left: 326px;
bottom: 143px;
z-index: 8;
color: rgba(178, 204, 210, 0.63);
font-size: 9px;
letter-spacing: 0.04em;
pointer-events: none;
}
.compass {
position: fixed;
right: 402px;
bottom: 145px;
z-index: 8;
width: 35px;
height: 35px;
border: 1px solid rgba(185, 219, 225, 0.18);
border-radius: 50%;
display: grid;
place-items: center;
color: #a7c2c8;
font-size: 9px;
font-weight: 800;
pointer-events: none;
}
.compass::before {
content: "";
position: absolute;
top: 3px;
left: 16px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-bottom: 6px solid var(--cyan);
}
@media (max-width: 1080px) {
.controls { width: 252px; }
.analysis { width: 326px; }
.map-hint { left: 289px; }
.compass { right: 365px; }
}
@media (max-width: 760px) {
.topbar { left: 12px; right: 12px; top: 12px; }
.brand h1 { font-size: 16px; }
.brand h1 span { display: none; }
.controls {
top: 77px;
left: 12px;
width: 235px;
max-height: calc(100vh - 205px);
overflow-y: auto;
}
.analysis {
top: 77px;
right: 12px;
bottom: 142px;
width: min(310px, calc(100vw - 271px));
}
.timeline-panel { left: 12px; right: 12px; bottom: 12px; }
.map-hint, .compass { display: none; }
.timeline-legend { display: none; }
}
@media (max-width: 570px) {
.controls {
width: calc(100vw - 24px);
max-height: 180px;
}
.analysis {
top: auto;
bottom: 133px;
width: calc(100vw - 24px);
height: 34vh;
}
.metrics { display: none; }
.clock-label { display: none; }
.event-section { margin-top: 8px; }
}
</style>
</head>
<body>
<canvas id="scene" aria-label="Interactive low-poly satellite landscape"></canvas>
<div id="vignette"></div>
<div id="labels"></div>
<header class="topbar">
<div class="brand">
<div class="brand-icon"></div>
<div>
<div class="eyebrow">Revisit Lab / Sector 07</div>
<h1>Verdant Divide <span>· Event Observation Study</span></h1>
</div>
</div>
<div class="clock-block">
<div id="simClock">00:51</div>
<div class="clock-label">MISSION<br>ELAPSED</div>
</div>
</header>
<aside class="panel controls">
<div class="section-heading">
<h2>Mission Parameters</h2>
<span>FICTIONAL / 12 H</span>
</div>
<div class="control-block">
<div class="control-label">
<label for="intervalRange">Revisit interval</label>
<div class="control-value"><span id="intervalValue">45</span> <small>MIN</small></div>
</div>
<input id="intervalRange" type="range" min="15" max="180" step="5" value="45">
<div class="range-scale">
<span>15 MIN</span>
<span>90 MIN</span>
<span>180 MIN</span>
</div>
<div class="presets">
<button class="preset" data-minutes="15">15 min</button>
<button class="preset" data-minutes="30">30 min</button>
<button class="preset" data-minutes="45">45 min</button>
<button class="preset" data-minutes="60">60 min</button>
<button class="preset" data-minutes="120">120 min</button>
</div>
<p class="control-description">Time between scene-center overpasses. Shorter gaps create more timing opportunities.</p>
</div>
<div class="control-block">
<div class="control-label">
<label for="gsdRange">Ground sample distance</label>
<div class="control-value"><span id="gsdValue">15</span> <small>M</small></div>
</div>
<input id="gsdRange" type="range" min="5" max="30" step="5" value="15">
<div class="range-scale">
<span>5 M</span>
<span id="resolutionFloor">2-PIXEL FLOOR: 30 M</span>
<span>30 M</span>
</div>
<p class="control-description">Spatial detail is independent of revisit time. A feature must span at least two pixels to resolve.</p>
</div>
<div class="explanation">
<strong>Independent failure modes.</strong><br>
Orange events were absent at every pass. Violet events were present when observed, but smaller than the spatial resolution floor.
</div>
<div class="control-block" style="padding-bottom: 5px">
<label class="toggle-row">
<span>Pass geometry</span>
<span class="switch">
<input id="passToggle" type="checkbox" checked>
<span></span>
</span>
</label>
<label class="toggle-row">
<span>Event markers</span>
<span class="switch">
<input id="eventToggle" type="checkbox" checked>
<span></span>
</span>
</label>
<button id="resetView" class="preset" style="width: 100%; margin-top: 7px">Reset camera</button>
</div>
<div class="legend">
<div class="legend-item">
<i class="legend-dot" style="color:var(--green);background:var(--green)"></i>
Captured and resolved
</div>
<div class="legend-item">
<i class="legend-dot" style="color:var(--orange);background:var(--orange)"></i>
Missed between passes
</div>
<div class="legend-item">
<i class="legend-dot" style="color:var(--violet);background:var(--violet)"></i>
Below spatial resolution
</div>
</div>
</aside>
<aside class="panel analysis">
<div class="analysis-head">
<div class="section-heading">
<h2><span class="live-dot"></span>Live Detection Analysis</h2>
<span id="passCount">12 PASSES</span>
</div>
<div class="metrics">
<div class="metric green">
<span>Captured</span>
<strong id="observedCount">4</strong>
<small>timed + resolved</small>
</div>
<div class="metric orange">
<span>Brief misses</span>
<strong id="briefCount">3</strong>
<small>event ≤ 20 min</small>
</div>
<div class="metric violet">
<span>Spatial ceiling</span>
<strong id="spatialCount">2</strong>
<small>timely, unresolved</small>
</div>
</div>
<p id="coverageNote"></p>
</div>
<div id="selectedCard" class="selected-card"></div>
<div class="event-section">
<div class="event-toolbar">
<span>Event Ledger</span>
<div class="filters">
<button class="filter-button active" data-filter="all">All</button>
<button class="filter-button" data-filter="timing">Timing</button>
<button class="filter-button" data-filter="spatial">Spatial</button>
</div>
</div>
<div id="eventList"></div>
</div>
</aside>
<section class="panel timeline-panel">
<div class="timeline-toolbar">
<button id="playButton" class="play-button" aria-label="Play simulation">▶</button>
<div class="timeline-title">12-hour revisit timeline</div>
<div id="sceneStatus">LIVE PASS · CENTER OVERFLIGHT</div>
<div class="timeline-legend">
<span><i style="--legend-color:var(--cyan)"></i>Pass</span>
<span><i style="--legend-color:var(--green)"></i>Captured</span>
<span><i style="--legend-color:var(--orange)"></i>Timing gap</span>
<span><i style="--legend-color:var(--violet)"></i>Spatial limit</span>
</div>
</div>
<div id="timelineSvg"></div>
</section>
<div class="map-hint">Drag to orbit · Shift-drag to pan · Scroll to zoom · Click an event to inspect</div>
<div class="compass">N</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// ---------------------------------------------------------------------
// Data
// ---------------------------------------------------------------------
const HOURS = 12;
const MISSION_MINUTES = HOURS * 60;
const events = [
{
code: "E-01", name: "Ridge flare", onset: 34, duration: 8, size: 48,
x: -158, z: -76, description: "Short-lived thermal disturbance"
},
{
code: "E-02", name: "Orchard bloom", onset: 96, duration: 32, size: 110,
x: 76, z: -98, description: "Seasonal vegetation anomaly"
},
{
code: "E-03", name: "Silt pulse", onset: 132, duration: 18, size: 26,
x: 44, z: -52, description: "Narrow sediment plume"
},
{
code: "E-04", name: "Smoke wisp", onset: 181, duration: 11, size: 20,
x: 168, z: 28, description: "Sub-pixel atmospheric feature"
},
{
code: "E-05", name: "Mesa flash", onset: 224, duration: 9, size: 70,
x: -88, z: 84, description: "Brief high-reflectance event"
},
{
code: "E-06", name: "Foothill slip", onset: 268, duration: 42, size: 190,
x: 125, z: 126, description: "Persistent slope failure"
},
{
code: "E-07", name: "Delta spark", onset: 353, duration: 6, size: 35,
x: -207, z: 124, description: "Very brief surface disturbance"
},
{
code: "E-08", name: "Glacier shine", onset: 474, duration: 26, size: 80,
x: -118, z: -156, description: "Long-lived reflective patch"
},
{
code: "E-09", name: "West signal", onset: 596, duration: 14, size: 24,
x: 207, z: -134, description: "Small and short-lived event"
},
{
code: "E-10", name: "North crop burn", onset: 648, duration: 38, size: 120,
x: 7, z: 175, description: "Large persistent burn scar"
}
];
const STATUS = {
captured: { hex: "#65e4ae", color: 0x65e4ae, label: "Captured" },
temporal: { hex: "#ffad67", color: 0xffad67, label: "Timing gap" },
spatial: { hex: "#bb91ff", color: 0xbb91ff, label: "Spatial limit" },
both: { hex: "#ff7892", color: 0xff7892, label: "Both limits" }
};
const state = {
interval: 45,
gsd: 15,
current: 51,
playing: false,
selected: 0,
filter: "all",
showPasses: true,
showEvents: true
};
const $ = id => document.getElementById(id);
const labelsRoot = $("labels");
function formatTime(minutes) {
const m = Math.max(0, Math.min(MISSION_MINUTES, minutes));
const h = Math.floor(m / 60);
const mm = Math.floor(m % 60);
return `${String(h).padStart(2, "0")}:${String(mm).padStart(2, "0")}`;
}
function getPassTimes() {
const result = [];
for (let t = 6; t < MISSION_MINUTES; t += state.interval) result.push(t);
return result;
}
function classify(event) {
const passes = getPassTimes();
const hit = passes.find(t => t >= event.onset && t <= event.onset + event.duration);
const temporal = hit !== undefined;
const spatial = event.size >= state.gsd * 2;
let status = "captured";
if (!temporal && spatial) status = "temporal";
else if (temporal && !spatial) status = "spatial";
else if (!temporal && !spatial) status = "both";
return {
...event,
status,
temporal,
spatial,
hit,
passes,
floor: state.gsd * 2
};
}
// ---------------------------------------------------------------------
// Three.js scene
// ---------------------------------------------------------------------
const canvas = $("scene");
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x08151c);
scene.fog = new THREE.Fog(0x08151c, 670, 1180);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.5,
1600
);
const hemisphere = new THREE.HemisphereLight(0xa9dfe4, 0x223b2c, 2.25);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight(0xffedcf, 2.8);
sun.position.set(-220, 360, 150);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -360;
sun.shadow.camera.right = 360;
sun.shadow.camera.top = 300;
sun.shadow.camera.bottom = -300;
sun.shadow.camera.near = 20;
sun.shadow.camera.far = 850;
sun.shadow.bias = -0.0006;
scene.add(sun);
const rim = new THREE.DirectionalLight(0x5ebbd4, 0.8);
rim.position.set(260, 130, -260);
scene.add(rim);
const world = new THREE.Group();
scene.add(world);
function seededRandom(seed) {
let value = seed >>> 0;
return () => {
value += 0x6D2B79F5;
let t = value;
t = Math.imul(t ^ (t >>> 15), t | 1);
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
function terrainHeight(x, z) {
let h = 5;
h += 2.4 * Math.sin(x * 0.013);
h += 1.7 * Math.cos(z * 0.018);
h += 0.8 * Math.sin((x + z) * 0.03);
h += 58 * Math.exp(
-(
Math.pow((x + 130) / 100, 2) +
Math.pow((z + 45) / 80, 2)
)
);
h += 66 * Math.exp(
-(
Math.pow((x - 105) / 110, 2) +
Math.pow((z - 75) / 90, 2)
)
);
h += 29 * Math.exp(
-(
Math.pow((x + 5) / 80, 2) +
Math.pow((z + 165) / 65, 2)
)
);
h += 12 * Math.exp(
-(
Math.pow((x - 180) / 70, 2) +
Math.pow((z + 130) / 65, 2)
)
);
return Math.max(0.8, h);
}
function buildTerrain() {
const nx = 44;
const nz = 32;
const width = 560;
const depth = 420;
const dx = width / nx;
const dz = depth / nz;
const positions = [];
const colors = [];
const random = seededRandom(2047);
const low = new THREE.Color(0x285846);
const mid = new THREE.Color(0x557959);
const rock = new THREE.Color(0x798174);
const high = new THREE.Color(0xb1b6a0);
function pushTriangle(a, b, c) {
const average = (a[1] + b[1] + c[1]) / 3;
let color;
if (average < 12) color = low.clone();
else if (average < 31) color = low.clone().lerp(mid, (average - 12) / 19);
else if (average < 54) color = mid.clone().lerp(rock, (average - 31) / 23);
else color = rock.clone().lerp(high, Math.min(1, (average - 54) / 32));
color.multiplyScalar(0.88 + random() * 0.2);
for (const p of [a, b, c]) {
positions.push(p[0], p[1], p[2]);
colors.push(color.r, color.g, color.b);
}
}
for (let iz = 0; iz < nz; iz++) {
for (let ix = 0; ix < nx; ix++) {
const x0 = -width / 2 + ix * dx;
const z0 = -depth / 2 + iz * dz;
const x1 = x0 + dx;
const z1 = z0 + dz;
const a = [x0, terrainHeight(x0, z0), z0];
const b = [x1, terrainHeight(x1, z0), z0];
const c = [x0, terrainHeight(x0, z1), z1];
const d = [x1, terrainHeight(x1, z1), z1];
pushTriangle(a, c, b);
pushTriangle(b, c, d);
}
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));
geometry.computeVertexNormals();
const material = new THREE.MeshStandardMaterial({
vertexColors: true,
roughness: 0.96,
metalness: 0,
flatShading: true
});
const terrain = new THREE.Mesh(geometry, material);
terrain.receiveShadow = true;
world.add(terrain);
const wire = new THREE.Mesh(
geometry,
new THREE.MeshBasicMaterial({
color: 0xc6e6dc,
wireframe: true,
transparent: true,
opacity: 0.045,
depthWrite: false
})
);
world.add(wire);
const plinth = new THREE.Mesh(
new THREE.BoxGeometry(width, 9, depth),
new THREE.MeshStandardMaterial({
color: 0x172e31,
roughness: 1
})
);
plinth.position.y = -5;
world.add(plinth);
}
function riverZ(x) {
return -94 + 42 * Math.sin(x * 0.018) + 18 * Math.sin(x * 0.05);
}
function createRibbon(points, width, material, heightOffset = 0.5) {
const positions = [];
const indices = [];
for (let i = 0; i < points.length; i++) {
const previous = points[Math.max(0, i - 1)];
const next = points[Math.min(points.length - 1, i + 1)];
const tx = next.x - previous.x;
const tz = next.y - previous.y;
const length = Math.hypot(tx, tz) || 1;
const px = -tz / length;
const pz = tx / length;
const leftX = points[i].x + px * width / 2;
const leftZ = points[i].y + pz * width / 2;
const rightX = points[i].x - px * width / 2;
const rightZ = points[i].y - pz * width / 2;
positions.push(
leftX, terrainHeight(leftX, leftZ) + heightOffset, leftZ,
rightX, terrainHeight(rightX, rightZ) + heightOffset, rightZ
);
if (i < points.length - 1) {
const a = i * 2;
indices.push(a, a + 1, a + 2, a + 1, a + 3, a + 2);
}
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
geometry.setIndex(indices);
geometry.computeVertexNormals();
return new THREE.Mesh(geometry, material);
}
function buildWaterAndRoad() {
const riverPoints = [];
for (let x = -280; x <= 280; x += 8) {
riverPoints.push(new THREE.Vector2(x, riverZ(x)));
}
const river = createRibbon(
riverPoints,
8,
new THREE.MeshStandardMaterial({
color: 0x2e91a3,
roughness: 0.28,
metalness: 0.08,
emissive: 0x0c2630,
emissiveIntensity: 0.28,
side: THREE.DoubleSide
}),
0.75
);
river.receiveShadow = true;
world.add(river);
const roadPoints = [
new THREE.Vector2(-110, 140),
new THREE.Vector2(-54, 109),
new THREE.Vector2(10, 104),
new THREE.Vector2(67, 91),
new THREE.Vector2(126, 50),
new THREE.Vector2(177, -4)
];
const road = createRibbon(
roadPoints,
4.2,
new THREE.MeshStandardMaterial({
color: 0x9b8967,
roughness: 1,
side: THREE.DoubleSide
}),
0.38
);
world.add(road);
}
function buildVegetation() {
const random = seededRandom(991);
const treeGeometry = new THREE.ConeGeometry(2.5, 8, 5);
const treeMaterial = new THREE.MeshStandardMaterial({
color: 0x2b5f43,
roughness: 1,
flatShading: true
});
const count = 210;
const trees = new THREE.InstancedMesh(treeGeometry, treeMaterial, count);
const dummy = new THREE.Object3D();
const color = new THREE.Color();
let placed = 0;
let attempts = 0;
while (placed < count && attempts < 4000) {
attempts++;
const x = -265 + random() * 530;
const z = -195 + random() * 390;
const height = terrainHeight(x, z);
if (height > 48 || Math.abs(z - riverZ(x)) < 9) continue;
dummy.position.set(x, height + 4.1, z);
dummy.rotation.y = random() * Math.PI * 2;
const scale = 0.65 + random() * 1.15;
dummy.scale.set(scale, scale, scale);
dummy.updateMatrix();
trees.setMatrixAt(placed, dummy.matrix);
color.setHSL(0.34 + random() * 0.045, 0.28 + random() * 0.12, 0.19 + random() * 0.1);
trees.setColorAt(placed, color);
placed++;
}
trees.count = placed;
trees.receiveShadow = true;
world.add(trees);
const rockGeometry = new THREE.DodecahedronGeometry(4, 0);
const rockMaterial = new THREE.MeshStandardMaterial({
color: 0x747c70,
roughness: 1,
flatShading: true
});
const rocks = new THREE.InstancedMesh(rockGeometry, rockMaterial, 75);
for (let i = 0; i < 75; i++) {
const angle = random() * Math.PI * 2;
const radius = 60 + random() * 190;
const x = Math.cos(angle) * radius;
const z = Math.sin(angle) * radius * 0.72;
const scale = 0.6 + random() * 2.3;
dummy.position.set(x, terrainHeight(x, z) + scale * 1.2, z);
dummy.rotation.set(random(), random(), random());
dummy.scale.set(scale, scale * 0.65, scale * 0.8);
dummy.updateMatrix();
rocks.setMatrixAt(i, dummy.matrix);
}
world.add(rocks);
}
function buildVillage() {
const random = seededRandom(72);
const wallMaterial = new THREE.MeshStandardMaterial({
color: 0xc7b899,
roughness: 0.92
});
const roofMaterial = new THREE.MeshStandardMaterial({
color: 0x785047,
roughness: 0.9,
flatShading: true
});
for (let i = 0; i < 13; i++) {
const x = 20 + random() * 60;
const z = 90 + random() * 43;
const base = terrainHeight(x, z);
const width = 5 + random() * 3;
const depth = 5 + random() * 3;
const height = 4 + random() * 3;
const house = new THREE.Mesh(
new THREE.BoxGeometry(width, height, depth),
wallMaterial
);
house.position.set(x, base + height / 2, z);
house.castShadow = true;
house.receiveShadow = true;
world.add(house);
const roof = new THREE.Mesh(
new THREE.ConeGeometry(Math.max(width, depth) * 0.76, 3.4, 4),
roofMaterial
);
roof.position.set(x, base + height + 1.65, z);
roof.rotation.y = Math.PI / 4;
roof.castShadow = true;
world.add(roof);
}
}
buildTerrain();
buildWaterAndRoad();
buildVegetation();
buildVillage();
// ---------------------------------------------------------------------
// Satellite, track, footprint
// ---------------------------------------------------------------------
const passGroup = new THREE.Group();
scene.add(passGroup);
const trackStart = new THREE.Vector2(-330, -218);
const trackEnd = new THREE.Vector2(330, 218);
const trackPoints = [];
for (let i = 0; i <= 100; i++) {
const t = i / 100;
const x = THREE.MathUtils.lerp(trackStart.x, trackEnd.x, t);
const z = THREE.MathUtils.lerp(trackStart.y, trackEnd.y, t);
trackPoints.push(new THREE.Vector2(x, z));
}
const trackGeometry = new THREE.BufferGeometry().setFromPoints(
trackPoints.map(p => new THREE.Vector3(p.x, terrainHeight(p.x, p.y) + 1.1, p.y))
);
const trackLine = new THREE.Line(
trackGeometry,
new THREE.LineDashedMaterial({
color: 0x65d9e7,
dashSize: 7,
gapSize: 5,
transparent: true,
opacity: 0.75,
depthWrite: false
})
);
trackLine.computeLineDistances();
passGroup.add(trackLine);
const swath = createRibbon(
trackPoints,
43,
new THREE.MeshBasicMaterial({
color: 0x55c7d8,
transparent: true,
opacity: 0.085,
side: THREE.DoubleSide,
depthWrite: false
}),
0.65
);
passGroup.add(swath);
const footprintRoot = new THREE.Group();
const footprintMesh = new THREE.Mesh(
new THREE.PlaneGeometry(68, 24),
new THREE.MeshBasicMaterial({
color: 0x65e4ff,
transparent: true,
opacity: 0.18,
side: THREE.DoubleSide,
depthWrite: false
})
);
footprintMesh.rotation.x = -Math.PI / 2;
footprintRoot.add(footprintMesh);
const footprintBorder = new THREE.LineLoop(
new THREE.BufferGeometry().setFromPoints([
new THREE.Vector3(-34, 0.25, -12),
new THREE.Vector3(34, 0.25, -12),
new THREE.Vector3(34, 0.25, 12),
new THREE.Vector3(-34, 0.25, 12)
]),
new THREE.LineBasicMaterial({
color: 0x8cecff,
transparent: true,
opacity: 0.9,
depthWrite: false
})
);
footprintRoot.add(footprintBorder);
passGroup.add(footprintRoot);
const satellite = new THREE.Group();
const satelliteBody = new THREE.Mesh(
new THREE.BoxGeometry(4.6, 3.6, 3.8),
new THREE.MeshStandardMaterial({
color: 0xd3b86c,
metalness: 0.65,
roughness: 0.32
})
);
satellite.add(satelliteBody);
const solarMaterial = new THREE.MeshStandardMaterial({
color: 0x183e65,
metalness: 0.72,
roughness: 0.28,
emissive: 0x071a2c,
emissiveIntensity: 0.45
});
for (const side of [-1, 1]) {
const panel = new THREE.Mesh(
new THREE.BoxGeometry(11, 0.28, 5.3),
solarMaterial
);
panel.position.x = side * 8;
satellite.add(panel);
const boom = new THREE.Mesh(
new THREE.BoxGeometry(3, 0.45, 0.45),
new THREE.MeshStandardMaterial({ color: 0x9aa7a9, metalness: 0.8 })
);
boom.position.x = side * 3.8;
satellite.add(boom);
}
const antenna = new THREE.Mesh(
new THREE.CylinderGeometry(2.4, 2.4, 0.45, 12),
new THREE.MeshStandardMaterial({
color: 0xe5e2cf,
metalness: 0.45,
roughness: 0.4,
side: THREE.DoubleSide
})
);
antenna.position.y = 2.6;
satellite.add(antenna);
passGroup.add(satellite);
// ---------------------------------------------------------------------
// Event markers and resolution probe
// ---------------------------------------------------------------------
const eventGroup = new THREE.Group();
scene.add(eventGroup);
const markerRecords = [];
for (const event of events) {
const root = new THREE.Group();
const y = terrainHeight(event.x, event.z);
const ring = new THREE.Mesh(
new THREE.TorusGeometry(Math.max(1, event.size / 20), 0.48, 5, 28),
new THREE.MeshBasicMaterial({
color: 0x65e4ae,
transparent: true,
opacity: 0.7,
depthWrite: false
})
);
ring.rotation.x = Math.PI / 2;
ring.position.y = 1.2;
root.add(ring);
const glow = new THREE.Mesh(
new THREE.CircleGeometry(Math.max(1.5, event.size / 20) * 1.7, 24),
new THREE.MeshBasicMaterial({
color: 0x65e4ae,
transparent: true,
opacity: 0.075,
depthWrite: false
})
);
glow.rotation.x = -Math.PI / 2;
glow.position.y = 0.8;
root.add(glow);
const stem = new THREE.Mesh(
new THREE.CylinderGeometry(0.22, 0.22, 10, 6),
new THREE.MeshBasicMaterial({
color: 0x65e4ae,
transparent: true,
opacity: 0.55,
depthWrite: false
})
);
stem.position.y = 6;
root.add(stem);
root.position.set(event.x, y, event.z);
eventGroup.add(root);
const button = document.createElement("button");
button.className = "event-marker";
button.dataset.label = event.code;
button.title = `${event.name}: ${event.description}`;
button.addEventListener("click", () => selectEvent(events.indexOf(event), true));
labelsRoot.appendChild(button);
markerRecords.push({
event,
root,
ring,
glow,
stem,
button,
worldPosition: new THREE.Vector3(event.x, y + 11, event.z)
});
}
const probeMaterial = new THREE.LineBasicMaterial({
color: 0xbb91ff,
transparent: true,
opacity: 0.95,
depthWrite: false
});
const probe = new THREE.LineLoop(
new THREE.BufferGeometry().setFromPoints([
new THREE.Vector3(-0.5, 0, -0.5),
new THREE.Vector3(0.5, 0, -0.5),
new THREE.Vector3(0.5, 0, 0.5),
new THREE.Vector3(-0.5, 0, 0.5)
]),
probeMaterial
);
scene.add(probe);
const probeCross = new THREE.LineSegments(
new THREE.BufferGeometry().setFromPoints([
new THREE.Vector3(-0.7, 0, 0), new THREE.Vector3(0.7, 0, 0),
new THREE.Vector3(0, 0, -0.7), new THREE.Vector3(0, 0, 0.7)
]),
probeMaterial
);
scene.add(probeCross);
const landmarks = [
{ text: "MERIDIAN RIDGE", x: -125, z: -45 },
{ text: "SILT RIVER", x: -8, z: riverZ(-8) },
{ text: "CIRRUS VILLAGE", x: 43, z: 113 },
{ text: "NORTH MARSH", x: -27, z: 167 }
].map(item => {
const element = document.createElement("div");
element.className = "place-label";
element.textContent = item.text;
labelsRoot.appendChild(element);
return {
...item,
element,
position: new THREE.Vector3(item.x, terrainHeight(item.x, item.z) + 4, item.z)
};
});
// ---------------------------------------------------------------------
// Custom camera controls
// ---------------------------------------------------------------------
const cameraState = {
radius: 625,
theta: 0.72,
phi: 0.92,
target: new THREE.Vector3(0, 12, 0),
targetGoal: null,
radiusGoal: null
};
function applyCamera() {
const offset = new THREE.Vector3().setFromSphericalCoords(
cameraState.radius,
cameraState.phi,
cameraState.theta
);
camera.position.copy(cameraState.target).add(offset);
camera.lookAt(cameraState.target);
}
applyCamera();
let dragging = false;
let lastX = 0;
let lastY = 0;
let panning = false;
canvas.addEventListener("pointerdown", event => {
dragging = true;
panning = event.button === 2 || event.shiftKey;
lastX = event.clientX;
lastY = event.clientY;
canvas.setPointerCapture(event.pointerId);
cameraState.targetGoal = null;
cameraState.radiusGoal = null;
});
canvas.addEventListener("pointermove", event => {
if (!dragging) return;
const dx = event.clientX - lastX;
const dy = event.clientY - lastY;
lastX = event.clientX;
lastY = event.clientY;
if (panning) {
const forward = new THREE.Vector3().subVectors(
camera.position,
cameraState.target
);
forward.y = 0;
forward.normalize();
const right = new THREE.Vector3().crossVectors(
forward,
new THREE.Vector3(0, 1, 0)
).normalize();
const scale = cameraState.radius * 0.00125;
cameraState.target.addScaledVector(right, -dx * scale);
cameraState.target.addScaledVector(forward, dy * scale);
} else {
cameraState.theta -= dx * 0.0055;
cameraState.phi = THREE.MathUtils.clamp(
cameraState.phi - dy * 0.0045,
0.25,
1.38
);
}
});
function endDrag(event) {
dragging = false;
panning = false;
if (canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
}
canvas.addEventListener("pointerup", endDrag);
canvas.addEventListener("pointercancel", endDrag);
canvas.addEventListener("contextmenu", event => event.preventDefault());
canvas.addEventListener("wheel", event => {
event.preventDefault();
cameraState.radius = THREE.MathUtils.clamp(
cameraState.radius * Math.exp(event.deltaY * 0.001),
185,
900
);
cameraState.radiusGoal = null;
}, { passive: false });
// ---------------------------------------------------------------------
// Analysis rendering
// ---------------------------------------------------------------------
function statusReason(result) {
if (result.status === "captured") {
return `Captured by the ${formatTime(result.hit)} overpass and resolved by the sensor.`;
}
if (result.status === "temporal") {
return "The feature was large enough, but no pass occurred while it was active.";
}
if (result.status === "spatial") {
return "The pass saw the feature in time, but it was too small for the selected resolution.";
}
return "The feature was both absent between passes and smaller than the resolution floor.";
}
function renderSelected(result) {
const resultCard = $("selectedCard");
const temporalText = result.temporal
? `Observed at <strong>${formatTime(result.hit)}</strong>.`
: "No pass fell inside the event's active window.";
const spatialText = result.spatial
? `Its ${result.size} m width exceeds the ${result.floor} m two-pixel floor.`
: `Its ${result.size} m width is below the ${result.floor} m two-pixel floor (${state.gsd} m GSD).`;
let extra = "";
if (!result.temporal && !result.spatial) {
extra = `<div class="reason-block good"><strong>Independent fixes</strong>Use a shorter revisit interval and a finer GSD; either change alone leaves a failure mode.</div>`;
} else if (!result.temporal) {
extra = `<div class="reason-block good"><strong>Potential fix</strong>Shorten the revisit interval until a pass falls inside the ${result.duration}-minute window.</div>`;
} else if (!result.spatial) {
extra = `<div class="reason-block good"><strong>Potential fix</strong>Use a finer GSD or observe a feature wider than ${result.floor} m.</div>`;
} else {
extra = `<div class="reason-block good"><strong>Detection</strong>Timing and resolution both met their thresholds.</div>`;
}
resultCard.innerHTML = `
<div class="selected-top">
<div>
<div class="selected-code">${result.code} · ${formatTime(result.onset)}</div>
<h3>${result.name}</h3>
</div>
<span class="status-pill ${result.status}">${STATUS[result.status].label}</span>
</div>
<div class="event-meta">
<span>${result.duration} MIN ACTIVE</span>
<span>${result.size} M FEATURE</span>
<span>${state.gsd} M GSD</span>
</div>
<div class="reason-block timing">
<strong>Temporal opportunity</strong>
${temporalText}
</div>
<div class="reason-block space">
<strong>Spatial resolvability</strong>
${spatialText}
</div>
${extra}
`;
}
function renderEventList() {
const list = $("eventList");
const results = events.map(classify);
const filtered = results.filter(result => {
if (state.filter === "timing") {
return !result.temporal;
}
if (state.filter === "spatial") {
return !result.spatial;
}
return true;
});
list.innerHTML = filtered.map(result => {
let detail = "";
if (result.status === "captured") {
detail = `Pass at ${formatTime(result.hit)}`;
} else if (result.status === "temporal") {
detail = `No pass in ${result.duration}-minute window`;
} else if (result.status === "spatial") {
detail = `${result.size} m < ${result.floor} m floor`;
} else {
detail = `No pass · ${result.size} m < ${result.floor} m`;
}
return `
<button class="event-row ${events.indexOf(result) === state.selected ? "selected" : ""}"
data-index="${events.indexOf(result)}"
style="--event-color:${STATUS[result.status].hex}">
<span class="event-row-dot"></span>
<span class="event-row-name">
${result.code} · ${result.name}
<small>${detail}</small>
</span>
<span class="event-row-time">${formatTime(result.onset)}</span>
</button>
`;
}).join("");
}
function updateProbe(result) {
const floorWorld = result.floor / 10;
probe.scale.setScalar(Math.max(0.5, floorWorld));
probeCross.scale.setScalar(Math.max(0.5, floorWorld));
probe.position.set(result.x, terrainHeight(result.x, result.z) + 1.1, result.z);
probeCross.position.copy(probe.position);
const color = result.spatial ? 0x65e4ae : 0xbb91ff;
probeMaterial.color.setHex(color);
}
function updateMarkers() {
for (const marker of markerRecords) {
const result = classify(marker.event);
const color = STATUS[result.status].color;
const selected = events.indexOf(marker.event) === state.selected;
marker.ring.material.color.setHex(color);
marker.glow.material.color.setHex(color);
marker.stem.material.color.setHex(color);
marker.ring.material.opacity = selected ? 1 : 0.58;
marker.glow.material.opacity = selected ? 0.16 : 0.065;
marker.button.style.setProperty("--event-color", STATUS[result.status].hex);
marker.button.classList.toggle("selected", selected);
}
}
function renderAnalysis() {
const results = events.map(classify);
const observed = results.filter(result => result.status === "captured").length;
const briefMisses = results.filter(
result => !result.temporal && result.duration <= 20
).length;
const timelyUnresolved = results.filter(
result => result.temporal && !result.spatial
).length;
const timingGaps = results.filter(result => !result.temporal).length;
const belowFloor = results.filter(result => !result.spatial).length;
const longTiming = results.filter(
result => !result.temporal && result.duration > 20
).length;
$("observedCount").textContent = observed;
$("briefCount").textContent = briefMisses;
$("spatialCount").textContent = timelyUnresolved;
$("passCount").textContent = `${getPassTimes().length} PASSES`;
$("coverageNote").textContent =
`${observed} captured · ${timingGaps} no-pass gaps · ${belowFloor} features below the ${state.gsd * 2} m floor` +
(longTiming ? ` · ${longTiming} long-lived timing miss` : "");
renderSelected(results[state.selected]);
renderEventList();
updateMarkers();
updateProbe(results[state.selected]);
}
function selectEvent(index, focus = false) {
state.selected = index;
state.current = events[index].onset;
renderAnalysis();
updateClock();
if (focus) {
const event = events[index];
cameraState.targetGoal = new THREE.Vector3(
event.x,
terrainHeight(event.x, event.z) * 0.35,
event.z
);
cameraState.radiusGoal = 265;
}
}
// ---------------------------------------------------------------------
// Timeline
// ---------------------------------------------------------------------
function renderTimeline() {
const width = 1200;
const height = 62;
const passes = getPassTimes();
const results = events.map(classify);
let svg = `
<svg viewBox="0 0 ${width} ${height}" preserveAspectRatio="none" aria-label="Satellite revisit timeline">
<rect x="0" y="0" width="${width}" height="28" fill="rgba(101,217,231,0.025)"></rect>
`;
for (let hour = 0; hour <= HOURS; hour++) {
const x = hour / HOURS * width;
svg += `
<line x1="${x}" x2="${x}" y1="0" y2="${height}"
stroke="rgba(183,218,226,${hour % 3 === 0 ? 0.18 : 0.075})"
stroke-width="1"></line>
`;
}
for (const pass of passes) {
const x = pass / MISSION_MINUTES * width;
svg += `
<line x1="${x}" x2="${x}" y1="3" y2="31"
stroke="#65d9e7" stroke-width="1"
stroke-opacity="0.29"></line>
<circle cx="${x}" cy="5" r="1.7" fill="#65d9e7" fill-opacity="0.85"></circle>
`;
}
results.forEach((result, index) => {
const x = result.onset / MISSION_MINUTES * width;
const barWidth = Math.max(3, result.duration / MISSION_MINUTES * width);
const y = 35 + (index % 3) * 8;
const selected = index === state.selected;
svg += `
<g data-event="${index}" style="cursor:pointer">
<title>${result.code} ${result.name} — ${STATUS[result.status].label}</title>
<rect x="${x}" y="${y}" width="${barWidth}" height="5" rx="2.5"
fill="${STATUS[result.status].hex}"
fill-opacity="${selected ? 1 : 0.72}"></rect>
${selected ? `
<rect x="${x - 2}" y="${y - 2}" width="${barWidth + 4}" height="9" rx="4"
fill="none" stroke="#ffffff" stroke-opacity="0.8" stroke-width="1"></rect>
` : ""}
</g>
`;
});
const cursorX = state.current / MISSION_MINUTES * width;
svg += `
<line id="timelineCursor" x1="${cursorX}" x2="${cursorX}" y1="0" y2="${height}"
stroke="#ffffff" stroke-width="1.5" stroke-opacity="0.92"></line>
<polygon points="${cursorX - 4},0 ${cursorX + 4},0 ${cursorX},6"
fill="#ffffff"></polygon>
</svg>
`;
$("timelineSvg").innerHTML = svg;
const ticks = document.createElement("div");
ticks.id = "hourTicks";
for (let hour = 0; hour <= HOURS; hour += 2) {
const tick = document.createElement("span");
tick.className = "hour-tick";
tick.style.left = `${hour / HOURS * 100}%`;
tick.textContent = formatTime(hour * 60);
ticks.appendChild(tick);
}
$("timelineSvg").appendChild(ticks);
}
$("timelineSvg").addEventListener("click", event => {
const eventBar = event.target.closest("[data-event]");
if (eventBar) {
selectEvent(Number(eventBar.dataset.event), true);
return;
}
const rect = $("timelineSvg").getBoundingClientRect();
const ratio = THREE.MathUtils.clamp((event.clientX - rect.left) / rect.width, 0, 1);
state.current = ratio * MISSION_MINUTES;
updateClock();
});
// ---------------------------------------------------------------------
// UI events
// ---------------------------------------------------------------------
function updateRangeFill(input, min, max) {
const percent = (Number(input.value) - min) / (max - min) * 100;
input.style.setProperty("--range-fill", `${percent}%`);
}
function updateInterval(value) {
state.interval = Number(value);
$("intervalRange").value = state.interval;
$("intervalValue").textContent = state.interval;
updateRangeFill($("intervalRange"), 15, 180);
document.querySelectorAll(".preset[data-minutes]").forEach(button => {
button.classList.toggle("active", Number(button.dataset.minutes) === state.interval);
});
renderAnalysis();
renderTimeline();
}
$("intervalRange").addEventListener("input", event => {
updateInterval(event.target.value);
});
document.querySelectorAll(".preset[data-minutes]").forEach(button => {
button.addEventListener("click", () => updateInterval(button.dataset.minutes));
});
$("gsdRange").addEventListener("input", event => {
state.gsd = Number(event.target.value);
$("gsdValue").textContent = state.gsd;
$("resolutionFloor").textContent = `2-PIXEL FLOOR: ${state.gsd * 2} M`;
updateRangeFill($("gsdRange"), 5, 30);
renderAnalysis();
});
$("passToggle").addEventListener("change", event => {
state.showPasses = event.target.checked;
passGroup.visible = state.showPasses;
});
$("eventToggle").addEventListener("change", event => {
state.showEvents = event.target.checked;
eventGroup.visible = state.showEvents;
labelsRoot.querySelectorAll(".event-marker").forEach(marker => {
marker.style.display = state.showEvents ? "block" : "none";
});
});
$("resetView").addEventListener("click", () => {
cameraState.targetGoal = new THREE.Vector3(0, 12, 0);
cameraState.radiusGoal = 625;
cameraState.theta = 0.72;
cameraState.phi = 0.92;
});
$("eventList").addEventListener("click", event => {
const row = event.target.closest("[data-index]");
if (row) selectEvent(Number(row.dataset.index), true);
});
document.querySelectorAll(".filter-button").forEach(button => {
button.addEventListener("click", () => {
state.filter = button.dataset.filter;
document.querySelectorAll(".filter-button").forEach(item => {
item.classList.toggle("active", item === button);
});
renderEventList();
});
});
$("playButton").addEventListener("click", () => {
state.playing = !state.playing;
$("playButton").textContent = state.playing ? "Ⅱ" : "▶";
$("playButton").setAttribute(
"aria-label",
state.playing ? "Pause simulation" : "Play simulation"
);
});
// ---------------------------------------------------------------------
// Dynamic scene updates
// ---------------------------------------------------------------------
function updateClock() {
$("simClock").textContent = formatTime(state.current);
const cycleStart = Math.floor(state.current / state.interval) * state.interval;
const local = state.current - cycleStart;
if (local <= 12) {
const untilCenter = Math.abs(6 - local);
$("sceneStatus").textContent = untilCenter < 0.5
? "LIVE PASS · CENTER OVERFLIGHT"
: `LIVE PASS · ${Math.round(untilCenter)} MIN ${local < 6 ? "TO CENTER" : "SINCE CENTER"}`;
} else {
const untilNext = state.interval - local;
$("sceneStatus").textContent = `BETWEEN PASSES · NEXT CENTER IN ${Math.ceil(untilNext)} MIN`;
}
}
function updateSatellite() {
const cycleStart = Math.floor(state.current / state.interval) * state.interval;
const local = state.current - cycleStart;
const visible = local <= 12;
satellite.visible = visible;
footprintRoot.visible = visible;
if (!visible) return;
const t = THREE.MathUtils.clamp(local / 12, 0, 1);
const x = THREE.MathUtils.lerp(trackStart.x, trackEnd.x, t);
const z = THREE.MathUtils.lerp(trackStart.y, trackEnd.y, t);
const ground = terrainHeight(x, z);
footprintRoot.position.set(x, ground + 1.0, z);
footprintRoot.rotation.y = Math.atan2(trackEnd.x - trackStart.x, trackEnd.y - trackStart.y);
satellite.position.set(x, ground + 43, z);
satellite.rotation.y = footprintRoot.rotation.y;
satellite.rotation.z = Math.sin(t * Math.PI) * 0.08;
}
const projected = new THREE.Vector3();
function projectLabel(position, element) {
projected.copy(position).project(camera);
const visible =
projected.z > -1 &&
projected.z < 1 &&
projected.x > -1.08 &&
projected.x < 1.08 &&
projected.y > -1.08 &&
projected.y < 1.08;
element.style.display = visible ? "block" : "none";
element.style.left = `${(projected.x * 0.5 + 0.5) * window.innerWidth}px`;
element.style.top = `${(-projected.y * 0.5 + 0.5) * window.innerHeight}px`;
}
function updateLabels() {
for (const marker of markerRecords) {
projectLabel(marker.worldPosition, marker.button);
}
for (const landmark of landmarks) {
projectLabel(landmark.position, landmark.element);
}
}
function updateTimelineCursor() {
const cursor = document.getElementById("timelineCursor");
if (!cursor) return;
const x = state.current / MISSION_MINUTES * 1200;
cursor.setAttribute("x1", x);
cursor.setAttribute("x2", x);
cursor.setAttribute("points", `${x - 4},0 ${x + 4},0 ${x},6`);
}
function onResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
}
window.addEventListener("resize", onResize);
// ---------------------------------------------------------------------
// Initialization and animation
// ---------------------------------------------------------------------
updateRangeFill($("intervalRange"), 15, 180);
updateRangeFill($("gsdRange"), 5, 30);
document.querySelector('.preset[data-minutes="45"]').classList.add("active");
renderAnalysis();
renderTimeline();
updateClock();
updateSatellite();
let previousTime = performance.now();
function animate(now) {
const dt = Math.min(0.05, (now - previousTime) / 1000);
previousTime = now;
if (state.playing) {
state.current += dt * 8;
if (state.current >= MISSION_MINUTES) {
state.current -= MISSION_MINUTES;
}
updateClock();
updateTimelineCursor();
}
if (cameraState.targetGoal) {
cameraState.target.lerp(cameraState.targetGoal, 0.075);
if (cameraState.target.distanceTo(cameraState.targetGoal) < 0.25) {
cameraState.target.copy(cameraState.targetGoal);
cameraState.targetGoal = null;
}
}
if (cameraState.radiusGoal !== null) {
cameraState.radius += (cameraState.radiusGoal - cameraState.radius) * 0.075;
if (Math.abs(cameraState.radiusGoal - cameraState.radius) < 0.4) {
cameraState.radius = cameraState.radiusGoal;
cameraState.radiusGoal = null;
}
}
applyCamera();
updateSatellite();
footprintMesh.material.opacity = 0.15 + Math.sin(now * 0.003) * 0.035;
camera.updateMatrixWorld();
updateLabels();
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
</script>
</body>
</html>
```