Prompt specification
Build or customize the Three.js 3D scene "Certificate name-and-recipient pair" 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: Certificate name-and-recipient pair
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/certificate-name-and-recipient-pair-x3869
Scene Description Prompt:
Certificate name-and-recipient pair. Show a rolled certificate, program card, and seated attendee marker sharing one symbol; keep recognition identity distinct from the order number printed on the program. Please build this with Three.js from cdnjs in one self-contained HTML file, using stylized solid shapes.
Working Three.js Starter (certificate-name-and-recipient-pair-x3869):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Linked Recognition — Three.js</title>
<style>
:root {
--ink: #173f43;
--ink-soft: #315c5d;
--paper: #f7f0df;
--cream: #fffaf0;
--gold: #c79a3b;
--gold-light: #e4c578;
--terracotta: #c86f4f;
--line: rgba(23, 63, 67, 0.16);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #e9e2d5;
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#app,
#scene {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
}
#scene {
display: block;
touch-action: none;
outline: none;
}
.hud {
position: fixed;
inset: 0;
pointer-events: none;
}
.title-block {
position: absolute;
top: clamp(18px, 3vw, 38px);
left: clamp(18px, 3vw, 42px);
max-width: 430px;
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 9px;
margin-bottom: 10px;
color: var(--ink-soft);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.eyebrow::before {
width: 8px;
height: 8px;
content: "";
background: var(--gold);
transform: rotate(45deg);
box-shadow: 0 0 0 4px rgba(199, 154, 59, 0.15);
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(30px, 4vw, 54px);
font-weight: 500;
line-height: 0.98;
letter-spacing: -0.035em;
}
.subtitle {
max-width: 360px;
margin: 13px 0 0;
color: var(--ink-soft);
font-size: 13px;
line-height: 1.55;
}
.ledger {
position: absolute;
top: clamp(18px, 3vw, 38px);
right: clamp(18px, 3vw, 42px);
width: min(330px, calc(100vw - 36px));
padding: 17px 18px;
border: 1px solid rgba(255, 255, 255, 0.75);
border-radius: 16px;
background: rgba(255, 250, 240, 0.78);
box-shadow:
0 18px 60px rgba(39, 50, 43, 0.11),
inset 0 0 0 1px rgba(23, 63, 67, 0.04);
backdrop-filter: blur(16px);
}
.ledger-label {
margin-bottom: 11px;
color: var(--ink-soft);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.ledger-row {
display: grid;
grid-template-columns: 105px 1fr;
gap: 12px;
padding: 9px 0;
border-top: 1px solid var(--line);
font-size: 12px;
line-height: 1.35;
}
.ledger-row span {
color: #6d7e79;
font-weight: 700;
}
.ledger-row strong {
font-weight: 750;
}
.ledger-row.order strong {
color: #8a5b23;
}
.record-card {
position: absolute;
right: clamp(18px, 3vw, 42px);
bottom: clamp(18px, 3vw, 38px);
width: min(360px, calc(100vw - 36px));
padding: 18px;
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 16px;
background: rgba(255, 250, 240, 0.88);
box-shadow: 0 18px 60px rgba(39, 50, 43, 0.12);
backdrop-filter: blur(16px);
transition: transform 180ms ease, opacity 180ms ease;
}
.record-head {
display: flex;
justify-content: space-between;
gap: 14px;
align-items: center;
margin-bottom: 12px;
font-size: 10px;
font-weight: 850;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.record-head span:last-child {
padding: 5px 8px;
border-radius: 999px;
background: rgba(199, 154, 59, 0.16);
color: #805a21;
white-space: nowrap;
}
.record-primary {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 27px;
font-weight: 500;
letter-spacing: -0.025em;
}
.record-secondary {
margin: 5px 0 0;
color: var(--ink-soft);
font-size: 12px;
font-weight: 650;
}
.record-note {
margin: 13px 0 0;
padding-top: 12px;
border-top: 1px solid var(--line);
color: #62736f;
font-size: 11px;
line-height: 1.5;
}
.toolbar {
position: absolute;
left: clamp(18px, 3vw, 42px);
bottom: clamp(18px, 3vw, 38px);
display: flex;
align-items: center;
gap: 10px;
pointer-events: auto;
}
button {
appearance: none;
border: 1px solid rgba(23, 63, 67, 0.15);
border-radius: 999px;
padding: 10px 15px;
background: rgba(255, 250, 240, 0.86);
color: var(--ink);
box-shadow: 0 7px 24px rgba(39, 50, 43, 0.08);
font: inherit;
font-size: 11px;
font-weight: 800;
letter-spacing: 0.04em;
cursor: pointer;
backdrop-filter: blur(12px);
transition:
transform 150ms ease,
background 150ms ease;
}
button:hover {
background: var(--cream);
transform: translateY(-1px);
}
button:active {
transform: translateY(0);
}
.hint {
color: rgba(23, 63, 67, 0.65);
font-size: 10px;
font-weight: 750;
letter-spacing: 0.07em;
text-transform: uppercase;
}
@media (max-width: 760px) {
.title-block {
max-width: 270px;
}
.subtitle {
display: none;
}
.ledger {
top: auto;
right: 14px;
bottom: 142px;
width: 230px;
padding: 12px 14px;
}
.ledger-row {
grid-template-columns: 78px 1fr;
gap: 8px;
padding: 7px 0;
font-size: 10px;
}
.record-card {
right: 14px;
bottom: 14px;
left: 14px;
width: auto;
padding: 14px;
}
.record-primary {
font-size: 22px;
}
.record-note {
display: none;
}
.toolbar {
left: 14px;
bottom: 128px;
}
.hint {
display: none;
}
}
</style>
</head>
<body>
<main id="app">
<canvas
id="scene"
tabindex="0"
aria-label="Interactive three-dimensional scene showing a rolled certificate, a program card, and a seated attendee marker connected by the same emblem."
></canvas>
<div class="hud">
<section class="title-block">
<div class="eyebrow">Recognition, linked</div>
<h1>One symbol.<br />Separate records.</h1>
<p class="subtitle">
The apex seal links the certificate, program, and attendee marker.
The recognition identity remains separate from the program order number.
</p>
</section>
<aside class="ledger" aria-label="Recognition and order summary">
<div class="ledger-label">Linked by the apex seal</div>
<div class="ledger-row">
<span>Recognition</span>
<strong>Avery Morgan · R-1042</strong>
</div>
<div class="ledger-row order">
<span>Program order</span>
<strong>#02847</strong>
</div>
</aside>
<aside class="record-card" aria-live="polite">
<div class="record-head">
<span id="recordType">Certificate</span>
<span id="recordTag">Recognition identity</span>
</div>
<p class="record-primary" id="recordPrimary">Avery Morgan</p>
<p class="record-secondary" id="recordSecondary">
Recognition ID · R-1042
</p>
<p class="record-note" id="recordNote">
The recipient identity belongs to the certificate. The program order
number is a separate transaction reference.
</p>
</aside>
<div class="toolbar">
<button id="resetView" type="button">Reset view</button>
<span class="hint">Drag to orbit · Scroll to zoom · Select an object</span>
</div>
</div>
</main>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const canvas = document.querySelector("#scene");
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
alpha: false,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xe9e2d5);
scene.fog = new THREE.Fog(0xe9e2d5, 13, 24);
const camera = new THREE.PerspectiveCamera(
38,
window.innerWidth / window.innerHeight,
0.1,
60
);
const target = new THREE.Vector3(0, 1.42, 0);
const spherical = new THREE.Spherical(11.4, 1.14, 0.13);
const minRadius = 7.4;
const maxRadius = 14.5;
function updateCamera() {
spherical.phi = THREE.MathUtils.clamp(spherical.phi, 0.7, 1.42);
spherical.theta = THREE.MathUtils.clamp(spherical.theta, -0.68, 0.68);
spherical.radius = THREE.MathUtils.clamp(
spherical.radius,
minRadius,
maxRadius
);
camera.position.setFromSpherical(spherical).add(target);
camera.lookAt(target);
}
updateCamera();
// Lighting
const hemisphere = new THREE.HemisphereLight(0xfff8e8, 0x688078, 2.25);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight(0xfff3d9, 3.15);
keyLight.position.set(-4.5, 8, 6.5);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -8;
keyLight.shadow.camera.right = 8;
keyLight.shadow.camera.top = 8;
keyLight.shadow.camera.bottom = -5;
keyLight.shadow.camera.near = 0.5;
keyLight.shadow.camera.far = 25;
keyLight.shadow.bias = -0.0004;
scene.add(keyLight);
const fillLight = new THREE.DirectionalLight(0xaed9d6, 1.2);
fillLight.position.set(6, 4, -4);
scene.add(fillLight);
const warmLight = new THREE.PointLight(0xffc97b, 12, 12, 2);
warmLight.position.set(-3, 3.5, 3);
scene.add(warmLight);
// Palette and materials
const materials = {
floor: new THREE.MeshStandardMaterial({
color: 0xe6dfd2,
roughness: 0.96,
metalness: 0
}),
paper: new THREE.MeshStandardMaterial({
color: 0xf6edda,
roughness: 0.82,
metalness: 0
}),
paperEdge: new THREE.MeshStandardMaterial({
color: 0xd8c6a5,
roughness: 0.9,
metalness: 0
}),
ink: new THREE.MeshStandardMaterial({
color: 0x173f43,
roughness: 0.74,
metalness: 0
}),
teal: new THREE.MeshStandardMaterial({
color: 0x0d4b4e,
roughness: 0.66,
metalness: 0.05
}),
tealDark: new THREE.MeshStandardMaterial({
color: 0x12383b,
roughness: 0.78,
metalness: 0
}),
gold: new THREE.MeshStandardMaterial({
color: 0xc79a3b,
roughness: 0.38,
metalness: 0.58
}),
goldLight: new THREE.MeshStandardMaterial({
color: 0xe4c578,
roughness: 0.42,
metalness: 0.42
}),
cream: new THREE.MeshStandardMaterial({
color: 0xfff8e8,
roughness: 0.72,
metalness: 0
}),
terracotta: new THREE.MeshStandardMaterial({
color: 0xc86f4f,
roughness: 0.82,
metalness: 0
}),
skin: new THREE.MeshStandardMaterial({
color: 0xd6a06f,
roughness: 0.9,
metalness: 0
}),
hair: new THREE.MeshStandardMaterial({
color: 0x302b28,
roughness: 0.95,
metalness: 0
})
};
function addBox(parent, size, position, material, castShadow = true) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(size[0], size[1], size[2]),
material
);
mesh.position.set(position[0], position[1], position[2]);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function addCylinder(
parent,
radiusTop,
radiusBottom,
height,
position,
material,
radialSegments = 32
) {
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(
radiusTop,
radiusBottom,
height,
radialSegments
),
material
);
mesh.position.set(position[0], position[1], position[2]);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
// Shared six-point apex symbol geometry.
const emblemGroup = new THREE.Group();
const emblemBack = new THREE.Mesh(
new THREE.CylinderGeometry(0.38, 0.38, 0.09, 48),
materials.gold
);
emblemBack.rotation.x = Math.PI / 2;
emblemBack.castShadow = true;
emblemGroup.add(emblemBack);
const emblemInner = new THREE.Mesh(
new THREE.CylinderGeometry(0.305, 0.305, 0.025, 48),
materials.cream
);
emblemInner.rotation.x = Math.PI / 2;
emblemInner.position.z = 0.052;
emblemInner.castShadow = true;
emblemGroup.add(emblemInner);
const starShape = new THREE.Shape();
const points = 6;
for (let i = 0; i < points * 2; i++) {
const radius = i % 2 === 0 ? 0.205 : 0.088;
const angle = (i * Math.PI) / points - Math.PI / 2;
const x = Math.cos(angle) * radius;
const y = Math.sin(angle) * radius;
if (i === 0) {
starShape.moveTo(x, y);
} else {
starShape.lineTo(x, y);
}
}
starShape.closePath();
const starGeometry = new THREE.ExtrudeGeometry(starShape, {
depth: 0.052,
bevelEnabled: true,
bevelSegments: 1,
bevelSize: 0.009,
bevelThickness: 0.009
});
starGeometry.translate(0, 0, -0.026);
const star = new THREE.Mesh(starGeometry, materials.teal);
star.position.z = 0.071;
star.castShadow = true;
emblemGroup.add(star);
const emblemRing = new THREE.Mesh(
new THREE.TorusGeometry(0.337, 0.019, 10, 48),
materials.goldLight
);
emblemRing.position.z = 0.064;
emblemRing.castShadow = true;
emblemGroup.add(emblemRing);
function createSharedEmblem(scale = 1) {
const emblem = emblemGroup.clone(true);
emblem.scale.setScalar(scale);
return emblem;
}
// Canvas text textures keep all typography local to this file.
function canvasTexture(width, height, draw) {
const textCanvas = document.createElement("canvas");
textCanvas.width = width;
textCanvas.height = height;
const context = textCanvas.getContext("2d");
draw(context, width, height);
const texture = new THREE.CanvasTexture(textCanvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
texture.needsUpdate = true;
return texture;
}
function labelPlane(width, height, texture) {
const material = new THREE.MeshStandardMaterial({
map: texture,
roughness: 0.84,
metalness: 0,
polygonOffset: true,
polygonOffsetFactor: -1
});
const mesh = new THREE.Mesh(
new THREE.PlaneGeometry(width, height),
material
);
mesh.receiveShadow = true;
return mesh;
}
const certificateTexture = canvasTexture(1024, 720, (ctx, w, h) => {
ctx.fillStyle = "#f7efdc";
ctx.fillRect(0, 0, w, h);
ctx.strokeStyle = "#c79a3b";
ctx.lineWidth = 5;
ctx.strokeRect(28, 28, w - 56, h - 56);
ctx.strokeStyle = "rgba(23, 63, 67, 0.22)";
ctx.lineWidth = 2;
ctx.strokeRect(43, 43, w - 86, h - 86);
ctx.textAlign = "center";
ctx.fillStyle = "#173f43";
ctx.font = "700 22px Arial, sans-serif";
ctx.fillText("THE APEX SOCIETY", w / 2, 44);
ctx.font = "700 31px Arial, sans-serif";
ctx.fillText("CERTIFICATE OF RECOGNITION", w / 2, 310);
ctx.fillStyle = "#6d7e79";
ctx.font = "700 18px Arial, sans-serif";
ctx.letterSpacing = "4px";
ctx.fillText("RECIPIENT", w / 2, 365);
ctx.fillStyle = "#173f43";
ctx.font = "500 70px Georgia, serif";
ctx.fillText("AVERY MORGAN", w / 2, 455);
ctx.fillStyle = "#8a5b23";
ctx.font = "700 21px Arial, sans-serif";
ctx.fillText("FOUNDING RECIPIENT", w / 2, 520);
ctx.strokeStyle = "rgba(199, 154, 59, 0.62)";
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(195, 565);
ctx.lineTo(w - 195, 565);
ctx.stroke();
ctx.fillStyle = "#6d7e79";
ctx.font = "700 17px Arial, sans-serif";
ctx.fillText("RECOGNITION ID", w / 2, 610);
ctx.fillStyle = "#173f43";
ctx.font = "700 26px Arial, sans-serif";
ctx.fillText("R-1042", w / 2, 651);
});
const programTexture = canvasTexture(1024, 760, (ctx, w, h) => {
ctx.fillStyle = "#0d4b4e";
ctx.fillRect(0, 0, w, h);
ctx.strokeStyle = "rgba(228, 197, 120, 0.82)";
ctx.lineWidth = 4;
ctx.strokeRect(26, 26, w - 52, h - 52);
ctx.textAlign = "center";
ctx.fillStyle = "#fff8e8";
ctx.font = "700 42px Arial, sans-serif";
ctx.fillText("PROGRAM", w / 2, 318);
ctx.fillStyle = "#e4c578";
ctx.font = "700 17px Arial, sans-serif";
ctx.fillText("ANNUAL RECOGNITION GALA", w / 2, 356);
ctx.strokeStyle = "rgba(255, 248, 232, 0.23)";
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(140, 395);
ctx.lineTo(w - 140, 395);
ctx.stroke();
ctx.fillStyle = "#b7cfca";
ctx.font = "700 18px Arial, sans-serif";
ctx.fillText("ORDER NUMBER", w / 2, 448);
ctx.fillStyle = "#fff8e8";
ctx.font = "700 92px Arial, sans-serif";
ctx.fillText("02847", w / 2, 557);
ctx.strokeStyle = "rgba(228, 197, 120, 0.7)";
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(140, 605);
ctx.lineTo(w - 140, 605);
ctx.stroke();
ctx.fillStyle = "#b7cfca";
ctx.font = "700 17px Arial, sans-serif";
ctx.fillText("GALLERY 04 · ROW B · SEAT 12", w / 2, 658);
});
const markerNameTexture = canvasTexture(700, 130, (ctx, w, h) => {
ctx.fillStyle = "#fff8e8";
ctx.fillRect(0, 0, w, h);
ctx.strokeStyle = "#c79a3b";
ctx.lineWidth = 5;
ctx.strokeRect(4, 4, w - 8, h - 8);
ctx.textAlign = "center";
ctx.fillStyle = "#173f43";
ctx.font = "700 44px Arial, sans-serif";
ctx.fillText("AVERY MORGAN", w / 2, 64);
ctx.fillStyle = "#8a5b23";
ctx.font = "700 21px Arial, sans-serif";
ctx.fillText("SEAT 12", w / 2, 103);
});
// Floor
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(40, 40),
materials.floor
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.012;
floor.receiveShadow = true;
scene.add(floor);
// Selection rings
function makeSelectionRing(radius, color) {
const ring = new THREE.Mesh(
new THREE.TorusGeometry(radius, 0.018, 8, 80),
new THREE.MeshBasicMaterial({
color,
transparent: true,
opacity: 0.75,
depthWrite: false
})
);
ring.rotation.x = Math.PI / 2;
ring.position.y = 0.018;
ring.visible = false;
scene.add(ring);
return ring;
}
const certificateRing = makeSelectionRing(1.42, 0xc79a3b);
certificateRing.position.x = -3.08;
const programRing = makeSelectionRing(1.22, 0xc79a3b);
programRing.position.x = 0.03;
const markerRing = makeSelectionRing(1.12, 0xc79a3b);
markerRing.position.x = 3.15;
// Rolled certificate
const certificateGroup = new THREE.Group();
certificateGroup.position.set(-3.08, 0, 0.12);
certificateGroup.rotation.y = 0.065;
scene.add(certificateGroup);
const certificatePanel = addBox(
certificateGroup,
[2.56, 1.86, 0.08],
[0, 2.02, 0.19],
materials.paper
);
const certificateLabel = labelPlane(
2.48,
1.78,
certificateTexture
);
certificateLabel.position.set(0, 2.02, 0.235);
certificateGroup.add(certificateLabel);
const certificateEmblem = createSharedEmblem(0.64);
certificateEmblem.position.set(0, 2.47, 0.285);
certificateGroup.add(certificateEmblem);
// Lower roll, with visible curled ends and a gold binding band.
const certificateRoll = addCylinder(
certificateGroup,
0.22,
0.22,
2.56,
[0, 1.02, 0.19],
materials.paper,
48
);
certificateRoll.rotation.z = Math.PI / 2;
for (const side of [-1, 1]) {
const outerSpiral = new THREE.Mesh(
new THREE.TorusGeometry(0.145, 0.026, 10, 36),
materials.paperEdge
);
outerSpiral.rotation.y = Math.PI / 2;
outerSpiral.position.set(side * 1.291, 1.02, 0.19);
outerSpiral.castShadow = true;
certificateGroup.add(outerSpiral);
const innerSpiral = new THREE.Mesh(
new THREE.TorusGeometry(0.072, 0.018, 10, 30),
materials.paperEdge
);
innerSpiral.rotation.y = Math.PI / 2;
innerSpiral.position.set(side * 1.302, 1.02, 0.19);
innerSpiral.castShadow = true;
certificateGroup.add(innerSpiral);
}
const bindingBand = new THREE.Mesh(
new THREE.TorusGeometry(0.235, 0.035, 10, 48),
materials.gold
);
bindingBand.rotation.y = Math.PI / 2;
bindingBand.position.set(-0.64, 1.02, 0.19);
bindingBand.castShadow = true;
certificateGroup.add(bindingBand);
// Program card
const programGroup = new THREE.Group();
programGroup.position.set(0.03, 1.55, 0.25);
programGroup.rotation.y = -0.075;
scene.add(programGroup);
addBox(
programGroup,
[2.18, 1.65, 0.10],
[0, 0, 0],
materials.teal
);
const programLabel = labelPlane(2.10, 1.57, programTexture);
programLabel.position.z = 0.057;
programGroup.add(programLabel);
const programEmblem = createSharedEmblem(0.61);
programEmblem.position.set(0, 0.50, 0.105);
programGroup.add(programEmblem);
addBox(
programGroup,
[0.14, 0.66, 0.14],
[0, -1.09, -0.01],
materials.tealDark
);
addBox(
programGroup,
[1.55, 0.14, 0.78],
[0, -1.43, -0.02],
materials.tealDark
);
addBox(
programGroup,
[1.62, 0.025, 0.83],
[0, -1.35, -0.02],
materials.gold
);
// Seated attendee and marker
const markerGroup = new THREE.Group();
markerGroup.position.set(3.15, 0, 0.10);
scene.add(markerGroup);
// Chair
addBox(
markerGroup,
[1.30, 0.18, 0.95],
[0, 0.75, 0.04],
materials.tealDark
);
addBox(
markerGroup,
[1.32, 1.32, 0.16],
[0, 1.64, -0.38],
materials.tealDark
);
addBox(
markerGroup,
[1.12, 0.94, 0.11],
[0, 1.62, -0.275],
materials.teal
);
for (const x of [-0.50, 0.50]) {
for (const z of [-0.32, 0.36]) {
addBox(
markerGroup,
[0.10, 0.75, 0.10],
[x, 0.375, z],
materials.tealDark
);
}
}
// Simplified seated attendee
const torso = new THREE.Mesh(
new THREE.SphereGeometry(0.5, 28, 18),
materials.terracotta
);
torso.scale.set(0.78, 1.12, 0.58);
torso.position.set(0, 1.62, 0.16);
torso.castShadow = true;
markerGroup.add(torso);
const head = new THREE.Mesh(
new THREE.SphereGeometry(0.27, 28, 20),
materials.skin
);
head.position.set(0, 2.27, 0.19);
head.castShadow = true;
markerGroup.add(head);
const hair = new THREE.Mesh(
new THREE.SphereGeometry(0.275, 28, 20),
materials.hair
);
hair.scale.set(1, 0.72, 1);
hair.position.set(0, 2.39, 0.15);
hair.castShadow = true;
markerGroup.add(hair);
for (const x of [-0.22, 0.22]) {
addBox(
markerGroup,
[0.24, 0.22, 0.72],
[x, 1.00, 0.43],
materials.terracotta
);
addBox(
markerGroup,
[0.22, 0.57, 0.23],
[x, 0.64, 0.76],
materials.ink
);
addBox(
markerGroup,
[0.25, 0.13, 0.39],
[x, 0.35, 0.84],
materials.hair
);
}
// Marker pole and disc
addBox(
markerGroup,
[0.075, 0.95, 0.075],
[0.84, 1.47, 0.28],
materials.gold
);
const markerDisc = addCylinder(
markerGroup,
0.44,
0.44,
0.09,
[0.84, 1.98, 0.32],
materials.gold,
48
);
markerDisc.rotation.x = Math.PI / 2;
const markerEmblem = createSharedEmblem(0.72);
markerEmblem.position.set(0.84, 1.98, 0.39);
markerGroup.add(markerEmblem);
addBox(
markerGroup,
[1.35, 0.30, 0.07],
[0.84, 1.37, 0.31],
materials.cream
);
const markerLabel = labelPlane(
1.31,
0.27,
markerNameTexture
);
markerLabel.position.set(0.84, 1.37, 0.351);
markerGroup.add(markerLabel);
// Make all three object groups selectable.
const pickRoots = [certificateGroup, programGroup, markerGroup];
function markPickable(root, key) {
root.traverse((object) => {
if (object.isMesh) {
object.userData.pickKey = key;
}
});
}
markPickable(certificateGroup, "certificate");
markPickable(programGroup, "program");
markPickable(markerGroup, "marker");
const records = {
certificate: {
type: "Certificate",
tag: "Recognition identity",
primary: "Avery Morgan",
secondary: "Recognition ID · R-1042",
note:
"The recipient identity belongs to the certificate. The program order number is a separate transaction reference."
},
program: {
type: "Program",
tag: "Order record",
primary: "Order #02847",
secondary: "Printed program reference",
note:
"The order number identifies the program entry. It is not the recipient identity and does not replace the recognition ID."
},
marker: {
type: "Seated attendee marker",
tag: "Attendee / seat",
primary: "Avery Morgan",
secondary: "Gallery 04 · Row B · Seat 12",
note:
"The attendee marker repeats the shared seal and the named identity while linking the recipient to a specific seat."
}
};
const recordType = document.querySelector("#recordType");
const recordTag = document.querySelector("#recordTag");
const recordPrimary = document.querySelector("#recordPrimary");
const recordSecondary = document.querySelector("#recordSecondary");
const recordNote = document.querySelector("#recordNote");
const rings = {
certificate: certificateRing,
program: programRing,
marker: markerRing
};
function selectRecord(key) {
const record = records[key];
if (!record) return;
recordType.textContent = record.type;
recordTag.textContent = record.tag;
recordPrimary.textContent = record.primary;
recordSecondary.textContent = record.secondary;
recordNote.textContent = record.note;
Object.entries(rings).forEach(([ringKey, ring]) => {
ring.visible = ringKey === key;
});
}
selectRecord("certificate");
// Direct camera controls: pointer orbit and wheel zoom.
let dragging = false;
let pointerId = null;
let previousX = 0;
let previousY = 0;
let pointerMoved = 0;
canvas.addEventListener("pointerdown", (event) => {
dragging = true;
pointerId = event.pointerId;
previousX = event.clientX;
previousY = event.clientY;
pointerMoved = 0;
canvas.setPointerCapture(event.pointerId);
canvas.style.cursor = "grabbing";
});
canvas.addEventListener("pointermove", (event) => {
if (!dragging || event.pointerId !== pointerId) return;
const deltaX = event.clientX - previousX;
const deltaY = event.clientY - previousY;
pointerMoved += Math.abs(deltaX) + Math.abs(deltaY);
spherical.theta -= deltaX * 0.0055;
spherical.phi -= deltaY * 0.0045;
previousX = event.clientX;
previousY = event.clientY;
});
canvas.addEventListener("pointerup", (event) => {
if (event.pointerId !== pointerId) return;
dragging = false;
canvas.style.cursor = "grab";
if (pointerMoved < 6) {
const bounds = canvas.getBoundingClientRect();
const pointer = new THREE.Vector2(
((event.clientX - bounds.left) / bounds.width) * 2 - 1,
-((event.clientY - bounds.top) / bounds.height) * 2 + 1
);
const raycaster = new THREE.Raycaster();
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(
pickRoots,
true
);
if (intersections.length) {
const hit = intersections.find(
(intersection) => intersection.object.userData.pickKey
);
if (hit) {
selectRecord(hit.object.userData.pickKey);
}
}
}
if (canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
pointerId = null;
});
canvas.addEventListener("pointercancel", () => {
dragging = false;
pointerId = null;
canvas.style.cursor = "grab";
});
canvas.addEventListener(
"wheel",
(event) => {
event.preventDefault();
spherical.radius += event.deltaY * 0.008;
},
{ passive: false }
);
canvas.style.cursor = "grab";
document.querySelector("#resetView").addEventListener("click", () => {
spherical.set(11.4, 1.14, 0.13);
target.set(0, 1.42, 0);
});
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
});
// Render loop
const clock = new THREE.Clock();
function animate() {
const delta = Math.min(clock.getDelta(), 0.05);
void delta;
updateCamera();
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>
```