Prompt specification
Build or customize the Three.js 3D scene "Character Crouch Before a Small Jump" 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: Character Crouch Before a Small Jump
Category: Games & Play · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/character-crouch-before-a-small-jump-x3689
Scene Description Prompt:
Please create one self-contained HTML file with Three.js from cdnjs showing jump anticipation poses. Model an original character in a preparatory crouch beside a neutral pose. Make lowered hips, bent knees, and planted feet readable from the same view. Low-poly.
Working Three.js Starter (character-crouch-before-a-small-jump-x3689):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rin-7 — Jump Anticipation Pose Study</title>
<style>
:root {
color-scheme: light;
--ink: #183033;
--muted: #526b6c;
--paper: rgba(250, 248, 241, 0.88);
--line: rgba(24, 48, 51, 0.16);
--orange: #ef6538;
--teal: #218f87;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background:
radial-gradient(circle at 18% 15%, rgba(255,255,255,0.95), transparent 35%),
linear-gradient(145deg, #dcebe6 0%, #edf1e9 50%, #e4ded1 100%);
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
#app {
position: fixed;
inset: 0;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
outline: none;
}
.hud {
position: fixed;
inset: 0;
z-index: 2;
pointer-events: none;
}
.title-block {
position: absolute;
top: 24px;
left: 28px;
max-width: min(440px, calc(100vw - 56px));
}
.eyebrow {
margin: 0 0 7px;
color: var(--teal);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.19em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(24px, 3vw, 40px);
font-weight: 750;
line-height: 1;
letter-spacing: -0.045em;
}
.subtitle {
margin: 10px 0 0;
color: var(--muted);
font-size: 13px;
line-height: 1.5;
}
.controls {
position: absolute;
top: 24px;
right: 28px;
display: flex;
gap: 8px;
align-items: center;
pointer-events: auto;
}
.view-chip,
button {
border: 1px solid var(--line);
border-radius: 999px;
background: var(--paper);
color: var(--ink);
box-shadow: 0 8px 28px rgba(24, 48, 51, 0.08);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
.view-chip {
padding: 9px 13px;
color: var(--muted);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
}
button {
padding: 9px 14px;
font: inherit;
font-size: 12px;
font-weight: 750;
cursor: pointer;
transition: transform 150ms ease, background 150ms ease;
}
button:hover {
background: #fffdf7;
transform: translateY(-1px);
}
button:active {
transform: translateY(0);
}
.hint {
position: absolute;
left: 28px;
bottom: 22px;
display: flex;
gap: 16px;
align-items: center;
color: var(--muted);
font-size: 11px;
font-weight: 650;
letter-spacing: 0.02em;
}
.hint span {
display: inline-flex;
align-items: center;
gap: 7px;
}
.dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--teal);
}
.dot.orange {
background: var(--orange);
}
.legend {
position: absolute;
right: 28px;
bottom: 22px;
padding: 11px 14px;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(250, 248, 241, 0.76);
color: var(--muted);
font-size: 10px;
line-height: 1.6;
text-align: right;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.legend strong {
color: var(--ink);
font-weight: 800;
letter-spacing: 0.08em;
}
@media (max-width: 700px) {
.title-block {
top: 18px;
left: 18px;
}
.subtitle,
.view-chip,
.legend {
display: none;
}
.controls {
top: 18px;
right: 18px;
}
.hint {
left: 18px;
bottom: 16px;
flex-direction: column;
align-items: flex-start;
gap: 5px;
}
}
</style>
</head>
<body>
<main id="app" aria-label="Interactive Three.js pose comparison"></main>
<div class="hud">
<section class="title-block">
<p class="eyebrow">Movement study / 02</p>
<h1>Rin-7: Anticipation</h1>
<p class="subtitle">
An original signal-runner character shown in a neutral stance and a
grounded pre-jump crouch.
</p>
</section>
<div class="controls">
<div class="view-chip">Orthographic study</div>
<button id="reset-view" type="button">Reset view</button>
</div>
<div class="hint">
<span><i class="dot"></i> Drag to orbit</span>
<span><i class="dot orange"></i> Shift-drag to pan · Scroll to zoom</span>
</div>
<div class="legend">
<strong>PREPARATION CUES</strong><br />
Lowered pelvis · Forward knees · Flat, planted feet
</div>
</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// ------------------------------------------------------------
// Renderer, scene, and orthographic comparison camera
// ------------------------------------------------------------
const app = document.querySelector("#app");
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor(0x000000, 0);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
renderer.domElement.setAttribute(
"aria-label",
"Two low-poly views of the same character: neutral pose and preparatory jump crouch"
);
app.appendChild(renderer.domElement);
const scene = new THREE.Scene();
const camera = new THREE.OrthographicCamera(-5, 5, 3, -3, 0.1, 100);
const orbit = {
theta: 0.30,
phi: 1.18,
zoom: 1,
target: new THREE.Vector3(0, 2.02, 0)
};
const initialOrbit = {
theta: 0.30,
phi: 1.18,
zoom: 1,
target: new THREE.Vector3(0, 2.02, 0)
};
function updateCamera() {
const radius = 10;
camera.position.set(
orbit.target.x + radius * Math.sin(orbit.phi) * Math.sin(orbit.theta),
orbit.target.y + radius * Math.cos(orbit.phi),
orbit.target.z + radius * Math.sin(orbit.phi) * Math.cos(orbit.theta)
);
camera.lookAt(orbit.target);
camera.zoom = orbit.zoom;
camera.updateProjectionMatrix();
}
function resize() {
const width = window.innerWidth;
const height = window.innerHeight;
const aspect = width / height;
// Preserve enough horizontal room for the side-by-side comparison.
const viewHeight = Math.max(5.65, 5.35 / aspect);
camera.left = (-viewHeight * aspect) / 2;
camera.right = (viewHeight * aspect) / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
renderer.setSize(width, height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
updateCamera();
}
window.addEventListener("resize", resize);
// ------------------------------------------------------------
// Lighting and stage
// ------------------------------------------------------------
const hemisphere = new THREE.HemisphereLight(0xffffff, 0x82938f, 1.9);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight(0xfff4df, 3.1);
keyLight.position.set(-3.5, 7, 5);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -6;
keyLight.shadow.camera.right = 6;
keyLight.shadow.camera.top = 7;
keyLight.shadow.camera.bottom = -2;
keyLight.shadow.camera.near = 0.5;
keyLight.shadow.camera.far = 20;
keyLight.shadow.bias = -0.00025;
scene.add(keyLight);
const rimLight = new THREE.DirectionalLight(0xb9fff4, 1.25);
rimLight.position.set(5, 4, -5);
scene.add(rimLight);
const ground = new THREE.Mesh(
new THREE.PlaneGeometry(30, 30),
new THREE.ShadowMaterial({
color: 0x183f3b,
opacity: 0.19
})
);
ground.rotation.x = -Math.PI / 2;
ground.position.y = -0.012;
ground.receiveShadow = true;
scene.add(ground);
const grid = new THREE.GridHelper(12, 24, 0x78918d, 0x9fb0aa);
grid.position.y = -0.006;
grid.material.transparent = true;
grid.material.opacity = 0.18;
grid.material.depthWrite = false;
scene.add(grid);
const padMaterialNeutral = new THREE.MeshStandardMaterial({
color: 0xe8eee8,
roughness: 0.94,
metalness: 0,
transparent: true,
opacity: 0.64
});
const padMaterialCrouch = new THREE.MeshStandardMaterial({
color: 0xf1dfd0,
roughness: 0.94,
metalness: 0,
transparent: true,
opacity: 0.68
});
function addPad(x, material, ringColor) {
const pad = new THREE.Mesh(
new THREE.CircleGeometry(0.94, 48),
material
);
pad.rotation.x = -Math.PI / 2;
pad.position.set(x, -0.003, 0);
pad.receiveShadow = true;
scene.add(pad);
const ring = new THREE.Mesh(
new THREE.RingGeometry(0.88, 0.91, 48),
new THREE.MeshBasicMaterial({
color: ringColor,
transparent: true,
opacity: 0.58,
side: THREE.DoubleSide
})
);
ring.rotation.x = -Math.PI / 2;
ring.position.set(x, 0.002, 0);
scene.add(ring);
}
addPad(-1.45, padMaterialNeutral, 0x218f87);
addPad(1.45, padMaterialCrouch, 0xef6538);
// ------------------------------------------------------------
// Shared low-poly material palette
// ------------------------------------------------------------
const materials = {
skin: new THREE.MeshStandardMaterial({
color: 0xc88f6a,
roughness: 0.86,
flatShading: true
}),
suit: new THREE.MeshStandardMaterial({
color: 0x233848,
roughness: 0.78,
flatShading: true
}),
suitLight: new THREE.MeshStandardMaterial({
color: 0x347f7b,
roughness: 0.76,
flatShading: true
}),
hair: new THREE.MeshStandardMaterial({
color: 0x173c42,
roughness: 0.9,
flatShading: true
}),
orange: new THREE.MeshStandardMaterial({
color: 0xef6538,
roughness: 0.72,
flatShading: true
}),
dark: new THREE.MeshStandardMaterial({
color: 0x14232a,
roughness: 0.9,
flatShading: true
}),
visor: new THREE.MeshStandardMaterial({
color: 0x102d32,
emissive: 0x102d32,
emissiveIntensity: 0.35,
roughness: 0.45,
flatShading: true
}),
glow: new THREE.MeshStandardMaterial({
color: 0x7ff4df,
emissive: 0x45d9c5,
emissiveIntensity: 1.8,
roughness: 0.3,
flatShading: true
})
};
// ------------------------------------------------------------
// Geometry helpers
// ------------------------------------------------------------
const Y_AXIS = new THREE.Vector3(0, 1, 0);
function addMesh(parent, geometry, material, position, scale) {
const mesh = new THREE.Mesh(geometry, material);
mesh.position.copy(position);
mesh.castShadow = true;
mesh.receiveShadow = true;
if (scale) {
mesh.scale.copy(scale);
}
parent.add(mesh);
return mesh;
}
function segment(parent, a, b, topRadius, bottomRadius, material, radialSegments = 6) {
const direction = new THREE.Vector3().subVectors(b, a);
const length = direction.length();
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(
topRadius,
bottomRadius,
length,
radialSegments,
1,
false
),
material
);
mesh.position.copy(a).add(b).multiplyScalar(0.5);
mesh.quaternion.setFromUnitVectors(
Y_AXIS,
direction.normalize()
);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function joint(parent, position, radius, material) {
return addMesh(
parent,
new THREE.IcosahedronGeometry(radius, 1),
material,
position
);
}
function makeFoot(parent, x, z, outwardAngle) {
const foot = new THREE.Group();
foot.position.set(x, 0, z - 0.03);
foot.rotation.y = outwardAngle;
parent.add(foot);
// Broad sole makes contact with the floor immediately readable.
addMesh(
foot,
new THREE.BoxGeometry(0.31, 0.055, 0.54),
materials.orange,
new THREE.Vector3(0, 0.028, 0.06)
);
addMesh(
foot,
new THREE.BoxGeometry(0.275, 0.16, 0.43),
materials.dark,
new THREE.Vector3(0, 0.12, 0.035)
);
addMesh(
foot,
new THREE.BoxGeometry(0.29, 0.08, 0.13),
materials.suitLight,
new THREE.Vector3(0, 0.205, 0.08)
);
}
// ------------------------------------------------------------
// Original character: Rin-7
// ------------------------------------------------------------
function makeCharacter(pose) {
const root = new THREE.Group();
root.rotation.y = pose === "crouch" ? -0.08 : -0.055;
const isCrouch = pose === "crouch";
const pelvis = isCrouch
? new THREE.Vector3(0, 1.43, 0.04)
: new THREE.Vector3(0, 2.18, 0);
const pelvisTop = isCrouch
? new THREE.Vector3(0, 1.59, 0.08)
: new THREE.Vector3(0, 2.34, 0);
const shoulderCenter = isCrouch
? new THREE.Vector3(0, 2.48, 0.30)
: new THREE.Vector3(0, 3.18, 0);
const headCenter = isCrouch
? new THREE.Vector3(0, 3.03, 0.34)
: new THREE.Vector3(0, 3.78, 0.015);
const hipY = isCrouch ? 1.34 : 2.04;
const kneeY = isCrouch ? 0.74 : 1.12;
const kneeZ = isCrouch ? 0.60 : 0.025;
const kneeX = isCrouch ? 0.43 : 0.25;
const ankleZ = isCrouch ? -0.30 : 0;
const ankleX = isCrouch ? 0.47 : 0.27;
// Pelvis and torso
addMesh(
root,
new THREE.CylinderGeometry(0.37, 0.32, 0.30, 6),
materials.suit,
pelvis,
new THREE.Vector3(1, 1, 0.74)
);
addMesh(
root,
new THREE.BoxGeometry(0.73, 0.105, 0.43),
materials.dark,
pelvis.clone().add(new THREE.Vector3(0, 0.015, 0)),
new THREE.Vector3(1, 1, 0.84)
);
const torso = segment(
root,
pelvisTop,
shoulderCenter,
0.45,
0.33,
materials.suit,
6
);
// Slight front-to-back compression gives the torso a faceted,
// non-boxy silhouette.
torso.scale.x = 0.94;
torso.scale.z = 0.73;
const torsoMid = pelvisTop.clone().add(shoulderCenter).multiplyScalar(0.5);
const badge = addMesh(
root,
new THREE.CircleGeometry(0.095, 3),
materials.orange,
torsoMid.clone().add(new THREE.Vector3(0.12, 0.08, 0.37))
);
badge.rotation.z = Math.PI / 2;
// Neck, scarf, and head
const neckBase = shoulderCenter.clone().add(new THREE.Vector3(0, 0.05, 0.005));
const neckTop = headCenter.clone().add(new THREE.Vector3(0, -0.25, -0.005));
segment(
root,
neckBase,
neckTop,
0.105,
0.12,
materials.skin,
6
);
const scarf = addMesh(
root,
new THREE.TorusGeometry(0.175, 0.045, 4, 10),
materials.orange,
neckBase.clone().add(new THREE.Vector3(0, 0.045, 0))
);
scarf.rotation.x = Math.PI / 2;
const scarfTail = addMesh(
root,
new THREE.ConeGeometry(0.095, 0.38, 3),
materials.orange,
neckBase.clone().add(new THREE.Vector3(0.20, -0.15, -0.10))
);
scarfTail.rotation.z = -0.18;
scarfTail.rotation.x = 0.58;
const head = new THREE.Group();
head.position.copy(headCenter);
head.rotation.y = 0.035;
root.add(head);
addMesh(
head,
new THREE.IcosahedronGeometry(0.31, 1),
materials.skin,
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(0.94, 1.02, 0.88)
);
addMesh(
head,
new THREE.SphereGeometry(0.315, 7, 3, 0, Math.PI * 2, 0, Math.PI * 0.55),
materials.hair,
new THREE.Vector3(0, 0.045, -0.005),
new THREE.Vector3(0.97, 0.96, 0.87)
);
// Asymmetric fin and ear unit make the character visually distinctive.
const fin = addMesh(
head,
new THREE.ConeGeometry(0.075, 0.42, 3),
materials.suitLight,
new THREE.Vector3(0.12, 0.31, -0.02)
);
fin.rotation.z = -0.27;
fin.rotation.x = 0.10;
addMesh(
head,
new THREE.BoxGeometry(0.10, 0.20, 0.17),
materials.orange,
new THREE.Vector3(-0.285, -0.015, 0.015),
new THREE.Vector3(1, 1, 1)
);
addMesh(
head,
new THREE.BoxGeometry(0.37, 0.11, 0.075),
materials.visor,
new THREE.Vector3(0, 0.015, 0.275)
);
addMesh(
head,
new THREE.BoxGeometry(0.255, 0.032, 0.022),
materials.glow,
new THREE.Vector3(0, 0.02, 0.318)
);
// Arms
const shoulderY = shoulderCenter.y - 0.03;
const elbowY = isCrouch ? 2.01 : 2.63;
const elbowZ = isCrouch ? -0.17 : 0.035;
const handY = isCrouch ? 1.66 : 2.13;
const handZ = isCrouch ? -0.51 : 0.08;
for (const side of [-1, 1]) {
const shoulder = new THREE.Vector3(
side * 0.40,
shoulderY,
shoulderCenter.z
);
const elbow = new THREE.Vector3(
side * (isCrouch ? 0.62 : 0.58),
elbowY,
elbowZ
);
const hand = new THREE.Vector3(
side * (isCrouch ? 0.53 : 0.62),
handY,
handZ
);
joint(root, shoulder, 0.155, materials.suitLight);
segment(root, shoulder, elbow, 0.135, 0.105, materials.suitLight, 6);
joint(root, elbow, 0.105, materials.dark);
segment(root, elbow, hand, 0.09, 0.075, materials.skin, 6);
joint(root, hand, 0.105, materials.skin);
}
// Legs
for (const side of [-1, 1]) {
const hip = new THREE.Vector3(
side * 0.22,
hipY,
isCrouch ? 0.025 : 0
);
const knee = new THREE.Vector3(
side * kneeX,
kneeY,
kneeZ
);
const ankle = new THREE.Vector3(
side * ankleX,
0.18,
ankleZ
);
joint(root, hip, 0.17, materials.suit);
segment(root, hip, knee, 0.175, 0.135, materials.suit, 6);
const kneePad = joint(root, knee, 0.17, materials.orange);
kneePad.scale.set(1.05, 0.88, 0.77);
segment(root, knee, ankle, 0.135, 0.095, materials.suitLight, 6);
joint(root, ankle, 0.105, materials.dark);
makeFoot(
root,
ankle.x,
ankle.z,
side * (isCrouch ? 0.11 : 0.055)
);
}
return root;
}
const neutralCharacter = makeCharacter("neutral");
neutralCharacter.position.x = -1.45;
scene.add(neutralCharacter);
const crouchCharacter = makeCharacter("crouch");
crouchCharacter.position.x = 1.45;
scene.add(crouchCharacter);
// ------------------------------------------------------------
// World-space labels, generated locally with CanvasTexture
// ------------------------------------------------------------
function roundedRect(ctx, x, y, width, height, radius) {
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.arcTo(x + width, y, x + width, y + height, radius);
ctx.arcTo(x + width, y + height, x, y + height, radius);
ctx.arcTo(x, y + height, x, y, radius);
ctx.arcTo(x, y, x + width, y, radius);
ctx.closePath();
}
function makeLabel(title, subtitle, accent) {
const canvas = document.createElement("canvas");
canvas.width = 768;
canvas.height = 192;
const ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
roundedRect(ctx, 8, 8, 752, 176, 30);
ctx.fillStyle = "rgba(247, 246, 239, 0.94)";
ctx.fill();
ctx.lineWidth = 5;
ctx.strokeStyle = accent;
ctx.stroke();
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillStyle = "#183033";
ctx.font = "800 54px system-ui, sans-serif";
ctx.fillText(title, 384, 72);
ctx.fillStyle = accent;
ctx.font = "700 25px system-ui, sans-serif";
ctx.fillText(subtitle, 384, 132);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.minFilter = THREE.LinearFilter;
const sprite = new THREE.Sprite(
new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthTest: false,
depthWrite: false
})
);
sprite.scale.set(2.45, 0.61, 1);
sprite.renderOrder = 20;
return sprite;
}
const neutralLabel = makeLabel(
"NEUTRAL",
"RELAXED / WEIGHT EVEN",
"#218f87"
);
neutralLabel.position.set(-1.45, 4.48, 0);
scene.add(neutralLabel);
const crouchLabel = makeLabel(
"ANTICIPATION",
"LOW HIPS / KNEES FORWARD / FEET PLANTED",
"#ef6538"
);
crouchLabel.position.set(1.45, 4.48, 0);
scene.add(crouchLabel);
// ------------------------------------------------------------
// Custom camera interaction implemented without external addons
// ------------------------------------------------------------
let drag = null;
renderer.domElement.addEventListener("contextmenu", (event) => {
event.preventDefault();
});
renderer.domElement.addEventListener("pointerdown", (event) => {
drag = {
id: event.pointerId,
x: event.clientX,
y: event.clientY,
pan: event.shiftKey || event.button === 2
};
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!drag || event.pointerId !== drag.id) return;
const dx = event.clientX - drag.x;
const dy = event.clientY - drag.y;
drag.x = event.clientX;
drag.y = event.clientY;
if (drag.pan) {
const worldPerPixel =
(camera.top - camera.bottom) / camera.zoom / window.innerHeight;
const cameraRight = new THREE.Vector3().setFromMatrixColumn(
camera.matrix,
0
);
const cameraUp = new THREE.Vector3().setFromMatrixColumn(
camera.matrix,
1
);
orbit.target
.addScaledVector(cameraRight, -dx * worldPerPixel)
.addScaledVector(cameraUp, dy * worldPerPixel);
} else {
orbit.theta -= dx * 0.006;
orbit.phi = THREE.MathUtils.clamp(
orbit.phi - dy * 0.005,
0.48,
1.48
);
}
updateCamera();
});
function endDrag(event) {
if (drag && event.pointerId === drag.id) {
drag = null;
}
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
orbit.zoom = THREE.MathUtils.clamp(
orbit.zoom * Math.exp(-event.deltaY * 0.001),
0.72,
2.25
);
updateCamera();
},
{ passive: false }
);
function resetView() {
orbit.theta = initialOrbit.theta;
orbit.phi = initialOrbit.phi;
orbit.zoom = initialOrbit.zoom;
orbit.target.copy(initialOrbit.target);
updateCamera();
}
document.querySelector("#reset-view").addEventListener("click", resetView);
renderer.domElement.addEventListener("dblclick", resetView);
// ------------------------------------------------------------
// Render loop
// ------------------------------------------------------------
resize();
updateCamera();
function animate() {
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>
```