Prompt specification
Build or customize the Three.js 3D scene "Support-versus-parasitism exhibit" 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: Support-versus-parasitism exhibit
Category: Biology & Nature · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/support-versus-parasitism-exhibit-x0736
Scene Description Prompt:
Create a single self-contained HTML file using Three.js from cdnjs that shows paired schematic plant relationships with clearly labeled resource arrows; users compare a selected epiphyte example and a parasitic example without treating all canopy plants as equivalent. Low-poly.
Working Three.js Starter (support-versus-parasitism-exhibit-x0736):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canopy Relationships — Epiphyte vs. Parasite</title>
<style>
:root {
color-scheme: dark;
--bg: #08130f;
--panel: #10201a;
--panel-2: #13271f;
--line: #29443a;
--text: #edf6ef;
--muted: #9db2a7;
--green: #80d6a2;
--gold: #f2c45e;
--blue: #5bc8ef;
--red: #ff756f;
--support: #b7b1a5;
}
* {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0;
min-width: 320px;
color: var(--text);
background:
radial-gradient(circle at 12% 0%, rgba(49, 112, 82, 0.22), transparent 33rem),
radial-gradient(circle at 90% 14%, rgba(42, 88, 104, 0.18), transparent 30rem),
var(--bg);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
line-height: 1.5;
}
button,
select {
font: inherit;
}
.shell {
width: min(1480px, calc(100% - 40px));
margin: 0 auto;
}
.hero {
padding: 58px 0 34px;
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
gap: 44px;
align-items: end;
}
.eyebrow {
margin: 0 0 15px;
color: var(--green);
font-size: 0.74rem;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
h1,
h2,
h3,
p {
margin-top: 0;
}
h1 {
max-width: 880px;
margin-bottom: 18px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(2.7rem, 5.4vw, 5.7rem);
font-weight: 500;
letter-spacing: -0.055em;
line-height: 0.97;
}
.hero-copy {
max-width: 820px;
margin: 0;
color: #b9c9c0;
font-size: clamp(1rem, 1.6vw, 1.22rem);
}
.hero-aside {
padding: 22px;
border: 1px solid var(--line);
border-radius: 18px;
background: rgba(15, 31, 25, 0.72);
backdrop-filter: blur(12px);
}
.hero-aside strong {
display: block;
margin-bottom: 8px;
color: var(--gold);
font-size: 0.79rem;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.hero-aside p {
margin: 0;
color: #c5d1ca;
font-size: 0.92rem;
}
.legend {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px 18px;
margin-bottom: 22px;
padding: 14px 18px;
border: 1px solid var(--line);
border-radius: 15px;
background: rgba(12, 25, 20, 0.75);
color: var(--muted);
font-size: 0.81rem;
}
.legend-title {
color: var(--text);
font-weight: 800;
letter-spacing: 0.09em;
text-transform: uppercase;
}
.legend-item {
display: inline-flex;
align-items: center;
gap: 7px;
white-space: nowrap;
}
.legend-arrow {
color: var(--legend-color);
font-size: 1.15rem;
font-weight: 900;
line-height: 1;
}
.legend-note {
margin-left: auto;
color: #82988d;
}
.comparison {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 22px;
}
.diagram-card {
overflow: hidden;
border: 1px solid var(--line);
border-radius: 23px;
background: linear-gradient(180deg, #12231d, #0d1b16);
box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}
.card-header {
padding: 20px 22px 18px;
}
.card-header-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
margin-bottom: 16px;
}
.role-tag {
display: inline-flex;
align-items: center;
min-height: 27px;
padding: 6px 9px;
border: 1px solid currentColor;
border-radius: 8px;
font-size: 0.65rem;
font-weight: 850;
letter-spacing: 0.09em;
line-height: 1.15;
text-transform: uppercase;
}
.role-tag.epiphyte {
color: var(--green);
background: rgba(128, 214, 162, 0.07);
}
.role-tag.parasite {
color: #ff918b;
background: rgba(255, 117, 111, 0.07);
}
.select-wrap {
display: flex;
align-items: center;
gap: 9px;
color: #7f998c;
font-size: 0.65rem;
font-weight: 800;
letter-spacing: 0.1em;
text-transform: uppercase;
}
select {
max-width: 230px;
padding: 8px 31px 8px 10px;
border: 1px solid #365045;
border-radius: 9px;
color: var(--text);
background: #10231b;
font-size: 0.78rem;
font-weight: 650;
letter-spacing: 0;
text-transform: none;
cursor: pointer;
}
select:focus-visible,
button:focus-visible,
canvas:focus-visible {
outline: 2px solid var(--gold);
outline-offset: 3px;
}
.card-header h2 {
margin-bottom: 4px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(1.45rem, 2.2vw, 2.05rem);
font-weight: 500;
letter-spacing: -0.025em;
}
.latin {
margin: 0;
color: var(--muted);
font-size: 0.83rem;
font-style: italic;
}
.viewport {
position: relative;
height: 500px;
overflow: hidden;
border-top: 1px solid rgba(65, 94, 82, 0.55);
border-bottom: 1px solid rgba(65, 94, 82, 0.55);
background:
linear-gradient(rgba(126, 170, 149, 0.055) 1px, transparent 1px),
linear-gradient(90deg, rgba(126, 170, 149, 0.055) 1px, transparent 1px),
radial-gradient(circle at 50% 55%, rgba(47, 94, 73, 0.17), transparent 58%),
#0b1814;
background-size: 32px 32px, 32px 32px, auto, auto;
}
canvas {
position: absolute;
inset: 0;
z-index: 1;
width: 100%;
height: 100%;
display: block;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.annotations {
position: absolute;
inset: 0;
z-index: 3;
overflow: hidden;
pointer-events: none;
}
.scene-label {
position: absolute;
max-width: 190px;
padding: 5px 8px;
border-radius: 7px;
transform: translate(-50%, -50%);
color: #dfeae3;
background: rgba(8, 19, 15, 0.9);
box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
font-size: 0.67rem;
font-weight: 750;
letter-spacing: 0.025em;
line-height: 1.3;
text-align: center;
white-space: normal;
backdrop-filter: blur(6px);
}
.scene-label.flow {
padding: 5px 8px 5px 6px;
border: 1px solid rgba(255, 255, 255, 0.09);
border-left: 3px solid var(--label-color);
text-align: left;
}
.scene-label.entity {
padding: 4px 7px;
border: 1px solid rgba(255, 255, 255, 0.1);
color: var(--label-color);
font-size: 0.61rem;
letter-spacing: 0.09em;
text-transform: uppercase;
}
.scene-label.note {
border: 1px dashed var(--label-color);
color: var(--label-color);
background: rgba(8, 19, 15, 0.76);
font-size: 0.61rem;
letter-spacing: 0.07em;
text-transform: uppercase;
}
.flow-arrow {
margin-right: 4px;
color: var(--label-color);
font-size: 0.92rem;
font-weight: 900;
}
.reset-button {
position: absolute;
z-index: 5;
top: 13px;
right: 13px;
width: 34px;
height: 34px;
border: 1px solid #3a5649;
border-radius: 50%;
color: #c9d8cf;
background: rgba(10, 23, 18, 0.82);
cursor: pointer;
font-size: 1.05rem;
line-height: 1;
backdrop-filter: blur(8px);
}
.reset-button:hover {
color: var(--gold);
border-color: var(--gold);
}
.viewport-hint,
.scale-note {
position: absolute;
z-index: 4;
bottom: 12px;
color: #728c7f;
font-size: 0.62rem;
font-weight: 700;
letter-spacing: 0.055em;
text-transform: uppercase;
pointer-events: none;
}
.viewport-hint {
left: 13px;
}
.scale-note {
right: 13px;
}
.readout {
padding: 21px 22px 23px;
}
.readout-label {
margin-bottom: 8px;
color: #799488;
font-size: 0.63rem;
font-weight: 850;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.readout h3 {
margin-bottom: 8px;
font-size: 1.03rem;
line-height: 1.35;
}
.readout > p {
margin-bottom: 18px;
color: #acbeb3;
font-size: 0.86rem;
}
.readout-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 9px;
}
.readout-cell {
min-height: 73px;
padding: 10px;
border: 1px solid #2c453a;
border-radius: 11px;
background: rgba(8, 20, 15, 0.38);
}
.readout-cell span {
display: block;
margin-bottom: 5px;
color: #769084;
font-size: 0.59rem;
font-weight: 800;
letter-spacing: 0.075em;
line-height: 1.3;
text-transform: uppercase;
}
.readout-cell strong {
display: block;
color: #dce9e1;
font-size: 0.75rem;
line-height: 1.35;
}
.principle {
display: grid;
grid-template-columns: 76px minmax(0, 1fr) auto;
gap: 22px;
align-items: center;
margin: 28px 0 48px;
padding: 28px;
border: 1px solid var(--line);
border-radius: 21px;
background:
linear-gradient(100deg, rgba(40, 83, 63, 0.22), transparent 55%),
#0e1d17;
}
.principle-number {
color: var(--green);
font-family: Georgia, "Times New Roman", serif;
font-size: 3rem;
line-height: 1;
}
.principle h2 {
margin-bottom: 7px;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(1.35rem, 2.3vw, 2.1rem);
font-weight: 500;
letter-spacing: -0.025em;
}
.principle p {
max-width: 940px;
margin: 0;
color: #a9bcb1;
font-size: 0.9rem;
}
.principle-badge {
padding: 10px 13px;
border: 1px solid #5c8f74;
border-radius: 10px;
color: var(--green);
background: rgba(128, 214, 162, 0.07);
font-size: 0.68rem;
font-weight: 850;
letter-spacing: 0.1em;
text-transform: uppercase;
white-space: nowrap;
}
.footer-note {
margin: -28px 0 30px;
color: #71897d;
font-size: 0.73rem;
}
@media (max-width: 980px) {
.hero {
grid-template-columns: 1fr;
gap: 24px;
}
.hero-aside {
max-width: 660px;
}
.comparison {
grid-template-columns: 1fr;
}
.viewport {
height: 470px;
}
}
@media (max-width: 640px) {
.shell {
width: min(100% - 22px, 1480px);
}
.hero {
padding-top: 34px;
}
h1 {
font-size: clamp(2.65rem, 14vw, 4.2rem);
}
.legend {
align-items: flex-start;
}
.legend-note {
width: 100%;
margin-left: 0;
}
.card-header-top {
align-items: flex-start;
flex-direction: column;
}
select {
max-width: min(100%, 290px);
}
.viewport {
height: 430px;
}
.readout-grid {
grid-template-columns: 1fr;
}
.readout-cell {
min-height: auto;
}
.principle {
grid-template-columns: 1fr;
gap: 13px;
padding: 22px;
}
.principle-number {
font-size: 2rem;
}
.principle-badge {
width: fit-content;
}
}
</style>
</head>
<body>
<main class="shell">
<header class="hero">
<div>
<p class="eyebrow">Botanical relationships · interactive comparison</p>
<h1>Two plants.<br>Two relationships.</h1>
<p class="hero-copy">
Growing on a tree does not automatically make a plant a parasite.
Compare how an epiphyte uses its host for support with how a parasitic
plant removes resources through specialized connections.
</p>
</div>
<aside class="hero-aside">
<strong>How to read the diagram</strong>
<p>
Colored arrows point toward the receiving organism. Follow the
resource—not merely the plant’s position in the canopy—to identify
the relationship.
</p>
</aside>
</header>
<section class="legend" aria-label="Arrow legend">
<span class="legend-title">Flow key</span>
<span class="legend-item">
<span class="legend-arrow" style="--legend-color: var(--gold)">→</span>
Light
</span>
<span class="legend-item">
<span class="legend-arrow" style="--legend-color: var(--blue)">→</span>
Water + minerals
</span>
<span class="legend-item">
<span class="legend-arrow" style="--legend-color: var(--red)">→</span>
Sugars / carbon
</span>
<span class="legend-item">
<span class="legend-arrow" style="--legend-color: var(--support)">→</span>
Physical support
</span>
<span class="legend-note">Arrowheads show the direction of resource transfer.</span>
</section>
<section class="comparison" aria-label="Paired plant relationship comparison">
<article class="diagram-card" id="epiphyteCard">
<header class="card-header">
<div class="card-header-top">
<span class="role-tag epiphyte" id="epiphyteBadge">
Support relationship · no host-sap flow
</span>
<label class="select-wrap" for="epiphyteSelect">
Example
<select id="epiphyteSelect">
<option value="aechmea">Aechmea — tank bromeliad</option>
<option value="orchid">Orchid — epiphytic plant</option>
<option value="moss">Spanish moss — Tillandsia</option>
</select>
</label>
</div>
<h2 id="epiphyteTitle">Aechmea tank bromeliad</h2>
<p class="latin" id="epiphyteLatin">Aechmea sp. · epiphyte on an oak</p>
</header>
<div class="viewport" id="epiphyteViewport">
<canvas
id="epiphyteCanvas"
tabindex="0"
aria-label="Interactive 3D schematic of an epiphyte on a host tree"
></canvas>
<div class="annotations" id="epiphyteAnnotations"></div>
<button
class="reset-button"
id="epiphyteReset"
type="button"
title="Reset camera"
aria-label="Reset epiphyte camera"
>↺</button>
<span class="viewport-hint">Drag to orbit · Scroll to zoom · Arrow keys</span>
<span class="scale-note">Schematic · not to scale</span>
</div>
<section class="readout">
<div class="readout-label">Read the relationship</div>
<h3 id="epiphyteSummaryTitle">Support, not host exploitation</h3>
<p id="epiphyteSummary"></p>
<div class="readout-grid">
<div class="readout-cell">
<span>Water + minerals</span>
<strong id="epiphyteWater"></strong>
</div>
<div class="readout-cell">
<span>Host carbon / sugars</span>
<strong id="epiphyteCarbon"></strong>
</div>
<div class="readout-cell">
<span>Role of the host</span>
<strong id="epiphyteHost"></strong>
</div>
</div>
</section>
</article>
<article class="diagram-card" id="parasiteCard">
<header class="card-header">
<div class="card-header-top">
<span class="role-tag parasite" id="parasiteBadge">
Hemiparasite · host xylem tap
</span>
<label class="select-wrap" for="parasiteSelect">
Example
<select id="parasiteSelect">
<option value="mistletoe">European mistletoe — on oak</option>
<option value="dodder">Dodder — on a shrub</option>
</select>
</label>
</div>
<h2 id="parasiteTitle">European mistletoe</h2>
<p class="latin" id="parasiteLatin">Viscum album · hemiparasite</p>
</header>
<div class="viewport" id="parasiteViewport">
<canvas
id="parasiteCanvas"
tabindex="0"
aria-label="Interactive 3D schematic of a parasitic plant on a host"
></canvas>
<div class="annotations" id="parasiteAnnotations"></div>
<button
class="reset-button"
id="parasiteReset"
type="button"
title="Reset camera"
aria-label="Reset parasite camera"
>↺</button>
<span class="viewport-hint">Drag to orbit · Scroll to zoom · Arrow keys</span>
<span class="scale-note">Schematic · not to scale</span>
</div>
<section class="readout">
<div class="readout-label">Read the relationship</div>
<h3 id="parasiteSummaryTitle">Resources move from host to parasite</h3>
<p id="parasiteSummary"></p>
<div class="readout-grid">
<div class="readout-cell">
<span>Water + minerals</span>
<strong id="parasiteWater"></strong>
</div>
<div class="readout-cell">
<span>Host carbon / sugars</span>
<strong id="parasiteCarbon"></strong>
</div>
<div class="readout-cell">
<span>Role of the host</span>
<strong id="parasiteHost"></strong>
</div>
</div>
</section>
</article>
</section>
<section class="principle">
<div class="principle-number">02</div>
<div>
<h2>Canopy is a location. Relationship is a mechanism.</h2>
<p id="takeawayText"></p>
</div>
<div class="principle-badge">Epiphyte ≠ parasite</div>
</section>
<p class="footer-note">
Educational schematic. Resource use and host specificity vary among
species; selected examples illustrate the broad mechanisms.
</p>
</main>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const COLORS = {
light: "#f2c45e",
water: "#5bc8ef",
carbon: "#ff756f",
support: "#b7b1a5",
green: "#80d6a2",
host: "#c4b293",
bark: "#73523a",
foliage: "#255f43",
foliageDark: "#194735"
};
const EPIPHYTE_DATA = {
aechmea: {
title: "Aechmea tank bromeliad",
latin: "Aechmea sp. · epiphyte on an oak",
badge: "Support relationship · no host-sap flow",
summaryTitle: "Support, not host exploitation",
summary:
"The rosette captures rainwater and receives nutrients as organic litter decomposes in its leaves. Its roots anchor it to the oak; it does not tap the host’s sap.",
water: "Rainwater and nutrients from trapped litter",
carbon: "Not extracted from the oak",
host: "Perch and anchor only",
flow: "Rainwater + nutrients from litter",
plantLabel: "Tank bromeliad",
hostLabel: "Oak host"
},
orchid: {
title: "Epiphytic orchid",
latin: "Orchidaceae · epiphyte on an oak",
badge: "Support relationship · no host-sap flow",
summaryTitle: "Aerial roots hold on without tapping sap",
summary:
"The orchid’s exposed roots cling to bark and gather moisture, humidity, and nutrients from dust and decomposing material. The oak provides a place to live rather than a food supply.",
water: "Humidity, rain, and nutrients from debris",
carbon: "Not extracted from the oak",
host: "Perch and anchor only",
flow: "Humidity + nutrients from debris",
plantLabel: "Epiphytic orchid",
hostLabel: "Oak host"
},
moss: {
title: "Spanish moss",
latin: "Tillandsia usneoides · epiphyte on an oak",
badge: "Support relationship · no host-sap flow",
summaryTitle: "An atmospheric epiphyte",
summary:
"Hanging strands intercept moisture and airborne dust. The branch mainly carries the plant into better light; there is no extraction of xylem or phloem resources from the oak.",
water: "Moisture and minerals from air and rain",
carbon: "Not extracted from the oak",
host: "Perch and anchor only",
flow: "Atmospheric moisture + nutrients",
plantLabel: "Spanish moss",
hostLabel: "Oak host"
}
};
const PARASITE_DATA = {
mistletoe: {
title: "European mistletoe",
latin: "Viscum album · hemiparasite on an oak",
badge: "Hemiparasite · host xylem tap",
summaryTitle: "Resources move from host to parasite",
summary:
"Mistletoe inserts haustoria into the oak’s xylem and withdraws water and dissolved minerals. It remains photosynthetic, so it makes most of its own sugars even though it parasitizes the host.",
water: "Taken from host xylem",
carbon: "Mostly produced by the mistletoe",
host: "Support and resource source",
flow: "Host xylem: water + minerals",
plantLabel: "Mistletoe",
hostLabel: "Oak host"
},
dodder: {
title: "Dodder",
latin: "Cuscuta sp. · holoparasite on a shrub",
badge: "Holoparasite · host vascular tap",
summaryTitle: "A nearly complete resource extraction",
summary:
"Dodder wraps around the shrub and forms haustorial connections with host vascular tissue. It takes water, minerals, and sugars, leaving little or no photosynthetic capacity of its own.",
water: "Taken from the host",
carbon: "Sugars taken from the host",
host: "Support and resource source",
flow: "Host xylem: water + minerals",
plantLabel: "Dodder",
hostLabel: "Shrub host"
}
};
const panels = [];
function makeMaterial(color, extra = {}) {
return new THREE.MeshStandardMaterial({
color,
roughness: 0.84,
metalness: 0,
flatShading: true,
...extra
});
}
function addMesh(parent, geometry, material, position) {
const mesh = new THREE.Mesh(geometry, material);
if (position) mesh.position.copy(position);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function cylinderBetween(
parent,
start,
end,
radiusBottom,
radiusTop,
material,
segments = 7
) {
const direction = end.clone().sub(start);
const length = direction.length();
const geometry = new THREE.CylinderGeometry(
radiusTop,
radiusBottom,
length,
segments,
1,
false
);
const mesh = addMesh(
parent,
geometry,
material,
start.clone().add(end).multiplyScalar(0.5)
);
mesh.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
direction.normalize()
);
return mesh;
}
function addBlob(parent, position, scale, material, radius = 0.45) {
const mesh = addMesh(
parent,
new THREE.IcosahedronGeometry(radius, 0),
material,
position
);
mesh.scale.copy(scale);
return mesh;
}
function addBase(scene) {
const baseMaterial = makeMaterial("#152c24");
const base = addMesh(
scene,
new THREE.CylinderGeometry(2.03, 2.12, 0.18, 28),
baseMaterial,
new THREE.Vector3(0, -0.1, 0)
);
base.castShadow = false;
const ring = new THREE.Mesh(
new THREE.TorusGeometry(1.82, 0.012, 4, 64),
new THREE.MeshBasicMaterial({ color: "#426758" })
);
ring.rotation.x = Math.PI / 2;
ring.position.y = 0.002;
scene.add(ring);
}
function addLighting(scene) {
scene.add(
new THREE.HemisphereLight("#c6eee0", "#26352e", 2.25)
);
const key = new THREE.DirectionalLight("#fff0cf", 3.1);
key.position.set(4.5, 7, 6);
key.castShadow = true;
key.shadow.mapSize.set(1024, 1024);
key.shadow.camera.left = -4;
key.shadow.camera.right = 4;
key.shadow.camera.top = 5;
key.shadow.camera.bottom = -2;
key.shadow.camera.near = 0.5;
key.shadow.camera.far = 18;
key.shadow.bias = -0.0006;
scene.add(key);
const rim = new THREE.DirectionalLight("#75b9c7", 1.1);
rim.position.set(-4, 3, -5);
scene.add(rim);
}
function addOakHost(scene) {
const bark = makeMaterial(COLORS.bark);
const barkLight = makeMaterial("#8b6547");
const foliage = makeMaterial(COLORS.foliage);
const foliageDark = makeMaterial(COLORS.foliageDark);
cylinderBetween(
scene,
new THREE.Vector3(-0.78, 0.02, -0.28),
new THREE.Vector3(-0.57, 2.65, -0.18),
0.3,
0.15,
bark
);
const supportBranch = new THREE.Vector3(0.3, 1.82, -0.02);
cylinderBetween(
scene,
new THREE.Vector3(-0.61, 1.48, -0.2),
supportBranch,
0.105,
0.052,
barkLight
);
cylinderBetween(
scene,
new THREE.Vector3(-0.59, 2.02, -0.2),
new THREE.Vector3(-1.22, 2.57, -0.04),
0.09,
0.04,
barkLight
);
cylinderBetween(
scene,
new THREE.Vector3(-0.58, 2.35, -0.2),
new THREE.Vector3(-0.12, 2.82, -0.3),
0.075,
0.035,
barkLight
);
addBlob(
scene,
new THREE.Vector3(-0.95, 3.04, -0.1),
new THREE.Vector3(1.1, 0.72, 0.8),
foliage,
0.6
);
addBlob(
scene,
new THREE.Vector3(-0.35, 3.24, -0.27),
new THREE.Vector3(0.92, 0.72, 0.7),
foliageDark,
0.56
);
addBlob(
scene,
new THREE.Vector3(-1.34, 2.74, 0.02),
new THREE.Vector3(0.76, 0.65, 0.65),
foliageDark,
0.5
);
addBlob(
scene,
new THREE.Vector3(-0.05, 2.83, -0.44),
new THREE.Vector3(0.7, 0.6, 0.58),
foliage,
0.48
);
return { supportBranch };
}
function addShrubHost(scene) {
const bark = makeMaterial("#684d39");
const foliage = makeMaterial("#356b46");
const foliageDark = makeMaterial("#224d38");
cylinderBetween(
scene,
new THREE.Vector3(-0.65, 0.02, -0.18),
new THREE.Vector3(-0.45, 1.5, -0.08),
0.22,
0.1,
bark
);
cylinderBetween(
scene,
new THREE.Vector3(-0.48, 1.12, -0.1),
new THREE.Vector3(0.27, 1.52, 0),
0.09,
0.035,
bark
);
cylinderBetween(
scene,
new THREE.Vector3(-0.47, 1.27, -0.1),
new THREE.Vector3(-0.1, 2.0, -0.16),
0.075,
0.03,
bark
);
addBlob(
scene,
new THREE.Vector3(0.15, 1.85, -0.12),
new THREE.Vector3(0.8, 0.62, 0.7),
foliage,
0.5
);
addBlob(
scene,
new THREE.Vector3(-0.38, 2.03, -0.2),
new THREE.Vector3(0.7, 0.57, 0.6),
foliageDark,
0.46
);
addBlob(
scene,
new THREE.Vector3(0.45, 1.58, -0.05),
new THREE.Vector3(0.63, 0.48, 0.55),
foliageDark,
0.42
);
return new THREE.Vector3(0.16, 1.63, 0.12);
}
function addBromeliad(scene, center) {
const leafA = makeMaterial("#4c9b65");
const leafB = makeMaterial("#78b86c");
const leafC = makeMaterial("#2f7650");
const flowers = makeMaterial("#d36f9d");
const leafMaterials = [leafA, leafB, leafC];
for (let i = 0; i < 10; i++) {
const angle = (i / 10) * Math.PI * 2;
const direction = new THREE.Vector3(
Math.cos(angle),
0.24 + (i % 3) * 0.07,
Math.sin(angle)
).normalize();
const leaf = addMesh(
scene,
new THREE.ConeGeometry(0.17, 0.73, 5),
leafMaterials[i % leafMaterials.length],
center.clone().addScaledVector(direction, 0.29)
);
leaf.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
direction
);
leaf.scale.z = 0.55;
}
addMesh(
scene,
new THREE.CylinderGeometry(0.2, 0.12, 0.16, 8),
leafC,
center.clone().add(new THREE.Vector3(0, 0.06, 0))
);
for (let i = 0; i < 7; i++) {
const angle = (i / 7) * Math.PI * 2;
const petal = addMesh(
scene,
new THREE.ConeGeometry(0.035, 0.18, 5),
flowers,
center.clone().add(
new THREE.Vector3(
Math.cos(angle) * 0.075,
0.19,
Math.sin(angle) * 0.075
)
)
);
petal.rotation.z = Math.cos(angle) * 0.35;
petal.rotation.x = Math.sin(angle) * 0.35;
}
}
function addOrchid(scene, center) {
const leafA = makeMaterial("#3f8f5c");
const leafB = makeMaterial("#68a965");
const roots = makeMaterial("#b79572");
const petal = makeMaterial("#d899c0");
const flowerCenter = makeMaterial("#e7bf5f");
for (let i = 0; i < 7; i++) {
const angle = (i / 7) * Math.PI * 2;
const direction = new THREE.Vector3(
Math.cos(angle),
0.18,
Math.sin(angle)
).normalize();
const leaf = addMesh(
scene,
new THREE.ConeGeometry(0.2, 0.72, 5),
i % 2 ? leafA : leafB,
center.clone().addScaledVector(direction, 0.27)
);
leaf.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
direction
);
leaf.scale.z = 0.42;
}
const stemTop = center.clone().add(new THREE.Vector3(0.02, 0.68, 0));
cylinderBetween(
scene,
center.clone().add(new THREE.Vector3(0, 0.05, 0)),
stemTop,
0.025,
0.018,
leafA,
6
);
for (let i = 0; i < 5; i++) {
const angle = (i / 5) * Math.PI * 2;
const p = addMesh(
scene,
new THREE.IcosahedronGeometry(0.13, 0),
petal,
stemTop.clone().add(
new THREE.Vector3(
Math.cos(angle) * 0.14,
0,
Math.sin(angle) * 0.14
)
)
);
p.scale.set(0.8, 0.27, 1.05);
p.rotation.y = -angle;
}
addMesh(
scene,
new THREE.IcosahedronGeometry(0.075, 0),
flowerCenter,
stemTop
);
for (let i = 0; i < 3; i++) {
const root = new THREE.Mesh(
new THREE.TorusGeometry(0.15 + i * 0.025, 0.018, 5, 18),
roots
);
root.position.copy(center).add(
new THREE.Vector3(-0.04 + i * 0.025, -0.13 - i * 0.035, 0)
);
root.rotation.set(0.5 + i * 0.6, i * 0.45, i * 0.8);
scene.add(root);
}
}
function addSpanishMoss(scene, center) {
const mossA = makeMaterial("#718c70");
const mossB = makeMaterial("#9aaa86");
const mossC = makeMaterial("#536f5b");
for (let i = 0; i < 17; i++) {
const phase = i * 1.73;
const x = center.x + Math.sin(phase) * 0.13;
const z = center.z + Math.cos(phase * 1.2) * 0.11;
const top = new THREE.Vector3(
x,
center.y - 0.02 - (i % 3) * 0.03,
z
);
const middle = new THREE.Vector3(
x + Math.sin(phase) * 0.06,
top.y - 0.34 - (i % 4) * 0.045,
z + Math.cos(phase) * 0.04
);
const bottom = new THREE.Vector3(
x + Math.sin(phase) * 0.1,
middle.y - 0.31 - (i % 3) * 0.05,
z + Math.cos(phase) * 0.07
);
cylinderBetween(
scene,
top,
middle,
0.013,
0.011,
i % 3 ? mossA : mossC,
5
);
cylinderBetween(
scene,
middle,
bottom,
0.011,
0.006,
i % 2 ? mossB : mossA,
5
);
}
}
function addMistletoe(scene, center) {
const leafA = makeMaterial("#4f965d");
const leafB = makeMaterial("#75aa66");
const berry = makeMaterial("#d7544f");
for (let i = 0; i < 8; i++) {
const angle = (i / 8) * Math.PI * 2;
const position = center.clone().add(
new THREE.Vector3(
Math.cos(angle) * 0.19,
0.04 + (i % 3) * 0.09,
Math.sin(angle) * 0.15
)
);
const leaf = addBlob(
scene,
position,
new THREE.Vector3(0.7, 0.32, 0.55),
i % 2 ? leafA : leafB,
0.22
);
leaf.rotation.y = angle;
}
for (let i = 0; i < 5; i++) {
const angle = i * 1.4;
addMesh(
scene,
new THREE.IcosahedronGeometry(0.055, 0),
berry,
center.clone().add(
new THREE.Vector3(
Math.cos(angle) * 0.12,
0.16 + (i % 2) * 0.08,
Math.sin(angle) * 0.1
)
)
);
}
const haustorium = makeMaterial("#a85e55");
cylinderBetween(
scene,
center.clone().add(new THREE.Vector3(-0.18, -0.12, 0)),
center.clone().add(new THREE.Vector3(-0.34, -0.2, -0.03)),
0.025,
0.012,
haustorium,
6
);
}
function addDodder(scene, center) {
const vine = makeMaterial("#d47a36");
const vineLight = makeMaterial("#ee9a48");
const flower = makeMaterial("#eee1c1");
const points = [
new THREE.Vector3(-0.62, 0.9, 0.3),
new THREE.Vector3(-0.28, 1.22, 0.35),
new THREE.Vector3(0.08, 1.43, 0.28),
new THREE.Vector3(0.43, 1.64, 0.15),
new THREE.Vector3(0.42, 1.96, -0.08),
new THREE.Vector3(0.08, 2.04, -0.24),
new THREE.Vector3(-0.28, 1.8, -0.25),
new THREE.Vector3(-0.52, 1.48, -0.2),
new THREE.Vector3(-0.62, 0.9, 0.3)
];
const curve = new THREE.CatmullRomCurve3(points, true, "catmullrom", 0.4);
const tube = new THREE.Mesh(
new THREE.TubeGeometry(curve, 80, 0.028, 6, true),
vine
);
tube.castShadow = true;
scene.add(tube);
const secondaryCurve = new THREE.CatmullRomCurve3([
new THREE.Vector3(-0.42, 1.18, 0.34),
new THREE.Vector3(0.02, 1.46, 0.34),
new THREE.Vector3(0.35, 1.73, 0.2),
new THREE.Vector3(0.2, 2.03, -0.05),
new THREE.Vector3(-0.14, 1.82, -0.2)
]);
const secondary = new THREE.Mesh(
new THREE.TubeGeometry(secondaryCurve, 48, 0.019, 5, false),
vineLight
);
secondary.castShadow = true;
scene.add(secondary);
for (let i = 0; i < 7; i++) {
const t = i / 7;
const p = curve.getPointAt(t);
addMesh(
scene,
new THREE.IcosahedronGeometry(0.045, 0),
flower,
p.clone().add(new THREE.Vector3(0.05, 0.03, 0.05))
);
}
const connection = makeMaterial("#9f584d");
cylinderBetween(
scene,
center.clone().add(new THREE.Vector3(-0.12, 0, 0.04)),
new THREE.Vector3(-0.43, 1.5, -0.07),
0.022,
0.01,
connection,
6
);
}
function addLabel(
panel,
text,
position,
kind = "entity",
color = "#dce9e1",
offset = [0, 0]
) {
const element = document.createElement("div");
element.className = `scene-label ${kind}`;
element.style.setProperty("--label-color", color);
if (kind === "flow") {
element.innerHTML =
`<span class="flow-arrow">→</span><span>${text}</span>`;
} else {
element.textContent = text;
}
panel.annotations.appendChild(element);
panel.labels.push({
element,
position: position.clone(),
offset
});
}
function addFlow(
panel,
start,
end,
color,
text,
bend,
labelPosition,
labelOffset = [0, 0]
) {
const curve = new THREE.QuadraticBezierCurve3(
start.clone(),
start.clone().add(end).multiplyScalar(0.5).add(bend),
end.clone()
);
const material = makeMaterial(color, {
emissive: new THREE.Color(color).multiplyScalar(0.22),
emissiveIntensity: 0.55
});
const shaft = new THREE.Mesh(
new THREE.TubeGeometry(curve, 32, 0.025, 6, false),
material
);
shaft.castShadow = true;
panel.scene.add(shaft);
const tangent = curve.getTangent(1).normalize();
const arrowhead = new THREE.Mesh(
new THREE.ConeGeometry(0.105, 0.29, 8),
material
);
arrowhead.position.copy(end);
arrowhead.quaternion.setFromUnitVectors(
new THREE.Vector3(0, 1, 0),
tangent
);
arrowhead.castShadow = true;
panel.scene.add(arrowhead);
const startDot = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.045, 0),
material
);
startDot.position.copy(start);
panel.scene.add(startDot);
if (text && labelPosition) {
addLabel(
panel,
text,
labelPosition,
"flow",
color,
labelOffset
);
}
}
function disposeScene(scene) {
const geometries = new Set();
const materials = new Set();
scene.traverse((object) => {
if (object.geometry) geometries.add(object.geometry);
if (object.material) {
const list = Array.isArray(object.material)
? object.material
: [object.material];
list.forEach((material) => materials.add(material));
}
});
geometries.forEach((geometry) => geometry.dispose());
materials.forEach((material) => material.dispose());
}
function updateEpiphyteReadout(data) {
document.getElementById("epiphyteTitle").textContent = data.title;
document.getElementById("epiphyteLatin").textContent = data.latin;
document.getElementById("epiphyteBadge").textContent = data.badge;
document.getElementById("epiphyteSummaryTitle").textContent =
data.summaryTitle;
document.getElementById("epiphyteSummary").textContent = data.summary;
document.getElementById("epiphyteWater").textContent = data.water;
document.getElementById("epiphyteCarbon").textContent = data.carbon;
document.getElementById("epiphyteHost").textContent = data.host;
}
function updateParasiteReadout(data) {
document.getElementById("parasiteTitle").textContent = data.title;
document.getElementById("parasiteLatin").textContent = data.latin;
document.getElementById("parasiteBadge").textContent = data.badge;
document.getElementById("parasiteSummaryTitle").textContent =
data.summaryTitle;
document.getElementById("parasiteSummary").textContent = data.summary;
document.getElementById("parasiteWater").textContent = data.water;
document.getElementById("parasiteCarbon").textContent = data.carbon;
document.getElementById("parasiteHost").textContent = data.host;
}
function updateTakeaway() {
const epiphyte =
EPIPHYTE_DATA[document.getElementById("epiphyteSelect").value];
const parasite =
PARASITE_DATA[document.getElementById("parasiteSelect").value];
document.getElementById("takeawayText").textContent =
`${epiphyte.plantLabel} uses its host primarily as a perch, while ` +
`${parasite.plantLabel.toLowerCase()} obtains resources from the host. ` +
`Both can occupy branches, but only the parasite removes host sap or ` +
`other host-derived resources in these examples.`;
}
function buildEpiphyte(panel, value) {
const data = EPIPHYTE_DATA[value];
const { supportBranch } = addOakHost(panel.scene);
let center;
let plantHeight;
if (value === "aechmea") {
center = supportBranch.clone().add(new THREE.Vector3(0.1, 0.19, 0));
plantHeight = 0.38;
addBromeliad(panel.scene, center);
} else if (value === "orchid") {
center = supportBranch.clone().add(new THREE.Vector3(0.06, 0.16, 0));
plantHeight = 0.72;
addOrchid(panel.scene, center);
} else {
center = supportBranch.clone().add(new THREE.Vector3(0.02, -0.02, 0));
plantHeight = 0.3;
addSpanishMoss(panel.scene, center);
}
addFlow(
panel,
new THREE.Vector3(-0.15, 1.61, 0.38),
new THREE.Vector3(0.21, 1.83, 0.26),
COLORS.support,
"Physical support only",
new THREE.Vector3(-0.04, 0.08, 0.18),
new THREE.Vector3(-0.18, 1.46, 0.64),
[0, 7]
);
addFlow(
panel,
new THREE.Vector3(1.62, 2.76, 0.72),
center.clone().add(new THREE.Vector3(0, 0.08, 0.16)),
COLORS.water,
data.flow,
new THREE.Vector3(0.3, 0.24, 0.12),
new THREE.Vector3(1.28, 2.83, 0.76),
[0, 0]
);
addFlow(
panel,
new THREE.Vector3(1.42, 3.72, -0.34),
center.clone().add(new THREE.Vector3(0, 0.18, -0.04)),
COLORS.light,
"Sunlight",
new THREE.Vector3(0.18, 0.25, -0.06),
new THREE.Vector3(1.22, 3.58, -0.12),
[0, 0]
);
addLabel(
panel,
data.hostLabel.toUpperCase(),
new THREE.Vector3(-0.69, 1.03, 0.36),
"entity",
COLORS.host,
[0, 0]
);
addLabel(
panel,
data.plantLabel.toUpperCase(),
center.clone().add(new THREE.Vector3(0, plantHeight, 0.03)),
"entity",
COLORS.green,
[0, -5]
);
addLabel(
panel,
"No host-sap flow",
new THREE.Vector3(-0.03, 1.34, 0.75),
"note",
COLORS.green,
[0, 8]
);
updateEpiphyteReadout(data);
}
function buildParasite(panel, value) {
const data = PARASITE_DATA[value];
let center;
let hostLabelPosition;
if (value === "mistletoe") {
const { supportBranch } = addOakHost(panel.scene);
center = supportBranch.clone().add(new THREE.Vector3(0.11, 0.2, 0));
hostLabelPosition = new THREE.Vector3(-0.69, 1.03, 0.36);
addMistletoe(panel.scene, center);
addFlow(
panel,
new THREE.Vector3(-0.52, 1.72, 0.58),
center.clone().add(new THREE.Vector3(0, 0.02, 0.16)),
COLORS.water,
data.flow,
new THREE.Vector3(-0.12, 0.18, 0.2),
new THREE.Vector3(-0.43, 2.18, 0.72),
[0, 0]
);
addLabel(
panel,
"Haustoria · host → parasite",
new THREE.Vector3(0.02, 1.66, 0.8),
"note",
COLORS.water,
[0, 0]
);
} else {
center = addShrubHost(panel.scene);
hostLabelPosition = new THREE.Vector3(-0.58, 0.93, 0.37);
addDodder(panel.scene, center);
addFlow(
panel,
new THREE.Vector3(-0.56, 1.13, 0.57),
center.clone().add(new THREE.Vector3(-0.02, 0, 0.12)),
COLORS.water,
"Host xylem: water + minerals",
new THREE.Vector3(-0.18, 0.16, 0.25),
new THREE.Vector3(-0.49, 1.42, 0.78),
[0, 0]
);
addFlow(
panel,
new THREE.Vector3(-0.16, 1.8, 0.58),
center.clone().add(new THREE.Vector3(0.04, 0.11, 0.1)),
COLORS.carbon,
"Host sugars / organic carbon",
new THREE.Vector3(0.18, 0.09, 0.17),
new THREE.Vector3(0.08, 2.08, 0.79),
[0, 0]
);
addLabel(
panel,
"Haustorial connection",
center.clone().add(new THREE.Vector3(-0.25, -0.18, 0.44)),
"note",
COLORS.carbon,
[0, 0]
);
}
addFlow(
panel,
new THREE.Vector3(1.48, 3.58, -0.3),
center.clone().add(new THREE.Vector3(0, 0.28, 0)),
COLORS.light,
"Sunlight",
new THREE.Vector3(0.14, 0.26, -0.06),
new THREE.Vector3(1.23, 3.43, -0.08),
[0, 0]
);
addLabel(
panel,
data.hostLabel.toUpperCase(),
hostLabelPosition,
"entity",
COLORS.host,
[0, 0]
);
addLabel(
panel,
data.plantLabel.toUpperCase(),
center.clone().add(new THREE.Vector3(0.12, 0.56, 0)),
"entity",
value === "mistletoe" ? "#8ad89a" : "#f09a55",
[0, -4]
);
updateParasiteReadout(data);
}
function buildPanelScene(panel) {
if (panel.scene) disposeScene(panel.scene);
panel.scene = new THREE.Scene();
panel.annotations.replaceChildren();
panel.labels = [];
addBase(panel.scene);
addLighting(panel.scene);
if (panel.kind === "epiphyte") {
buildEpiphyte(panel, panel.select.value);
} else {
buildParasite(panel, panel.select.value);
}
updateTakeaway();
}
function createControls(panel) {
const state = {
theta: 0.54,
phi: 1.17,
radius: 7.15
};
const target = new THREE.Vector3(0, 1.65, 0);
let dragging = false;
let previousX = 0;
let previousY = 0;
function apply() {
const sinPhi = Math.sin(state.phi);
panel.camera.position.set(
target.x + state.radius * sinPhi * Math.sin(state.theta),
target.y + state.radius * Math.cos(state.phi),
target.z + state.radius * sinPhi * Math.cos(state.theta)
);
panel.camera.lookAt(target);
}
function reset() {
state.theta = 0.54;
state.phi = 1.17;
state.radius = 7.15;
apply();
}
panel.canvas.addEventListener("pointerdown", (event) => {
if (event.pointerType === "mouse" && event.button !== 0) return;
dragging = true;
previousX = event.clientX;
previousY = event.clientY;
panel.canvas.setPointerCapture(event.pointerId);
});
panel.canvas.addEventListener("pointermove", (event) => {
if (!dragging) return;
const deltaX = event.clientX - previousX;
const deltaY = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
state.theta -= deltaX * 0.008;
state.phi = THREE.MathUtils.clamp(
state.phi - deltaY * 0.006,
0.57,
1.47
);
apply();
});
function endDrag(event) {
dragging = false;
if (panel.canvas.hasPointerCapture(event.pointerId)) {
panel.canvas.releasePointerCapture(event.pointerId);
}
}
panel.canvas.addEventListener("pointerup", endDrag);
panel.canvas.addEventListener("pointercancel", endDrag);
panel.canvas.addEventListener(
"wheel",
(event) => {
event.preventDefault();
state.radius = THREE.MathUtils.clamp(
state.radius * Math.exp(event.deltaY * 0.001),
5.2,
9.6
);
apply();
},
{ passive: false }
);
panel.canvas.addEventListener("dblclick", reset);
panel.canvas.addEventListener("keydown", (event) => {
let handled = true;
switch (event.key) {
case "ArrowLeft":
state.theta += 0.12;
break;
case "ArrowRight":
state.theta -= 0.12;
break;
case "ArrowUp":
state.phi = THREE.MathUtils.clamp(state.phi - 0.09, 0.57, 1.47);
break;
case "ArrowDown":
state.phi = THREE.MathUtils.clamp(state.phi + 0.09, 0.57, 1.47);
break;
case "+":
case "=":
state.radius = Math.max(5.2, state.radius - 0.35);
break;
case "-":
case "_":
state.radius = Math.min(9.6, state.radius + 0.35);
break;
case "0":
reset();
break;
default:
handled = false;
}
if (handled) {
event.preventDefault();
apply();
}
});
panel.resetButton.addEventListener("click", reset);
apply();
return { reset };
}
function updateProjectedLabels(panel) {
if (!panel.scene) return;
const width = panel.canvas.clientWidth;
const height = panel.canvas.clientHeight;
panel.labels.forEach((label) => {
const projected = label.position.clone().project(panel.camera);
const visible =
projected.z >= -1 &&
projected.z <= 1 &&
projected.x >= -1.25 &&
projected.x <= 1.25 &&
projected.y >= -1.2 &&
projected.y <= 1.2;
label.element.style.visibility = visible ? "visible" : "hidden";
const x = (projected.x * 0.5 + 0.5) * width + label.offset[0];
const y = (-projected.y * 0.5 + 0.5) * height + label.offset[1];
label.element.style.left = `${x}px`;
label.element.style.top = `${y}px`;
});
}
function setupPanel(kind) {
const isEpiphyte = kind === "epiphyte";
const prefix = isEpiphyte ? "epiphyte" : "parasite";
const panel = {
kind,
canvas: document.getElementById(`${prefix}Canvas`),
viewport: document.getElementById(`${prefix}Viewport`),
annotations: document.getElementById(`${prefix}Annotations`),
select: document.getElementById(`${prefix}Select`),
resetButton: document.getElementById(`${prefix}Reset`),
labels: [],
scene: null
};
panel.renderer = new THREE.WebGLRenderer({
canvas: panel.canvas,
antialias: true,
alpha: true,
powerPreference: "high-performance"
});
panel.renderer.setClearColor(0x000000, 0);
panel.renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 1.8));
panel.renderer.outputColorSpace = THREE.SRGBColorSpace;
panel.renderer.toneMapping = THREE.ACESFilmicToneMapping;
panel.renderer.toneMappingExposure = 1.05;
panel.renderer.shadowMap.enabled = true;
panel.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
panel.camera = new THREE.PerspectiveCamera(38, 1, 0.1, 50);
panel.controls = createControls(panel);
function resize() {
const width = Math.max(1, panel.viewport.clientWidth);
const height = Math.max(1, panel.viewport.clientHeight);
panel.renderer.setSize(width, height, false);
panel.camera.aspect = width / height;
panel.camera.updateProjectionMatrix();
}
const resizeObserver = new ResizeObserver(resize);
resizeObserver.observe(panel.viewport);
resize();
panel.select.addEventListener("change", () => {
buildPanelScene(panel);
});
buildPanelScene(panel);
panels.push(panel);
}
function animate() {
requestAnimationFrame(animate);
panels.forEach((panel) => {
if (!panel.scene) return;
panel.renderer.render(panel.scene, panel.camera);
updateProjectedLabels(panel);
});
}
setupPanel("epiphyte");
setupPanel("parasite");
animate();
</script>
</body>
</html>
```