Prompt specification
Build or customize the Three.js 3D scene "Figure Looking Toward a Marked Object" 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: Figure Looking Toward a Marked Object
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/figure-looking-toward-a-marked-object-x3381
Scene Description Prompt:
A stylized figure looks and points toward one of three objects, with gaze and finger aligned. Three.js from cdnjs, one HTML file.
Working Three.js Starter (figure-looking-toward-a-marked-object-x3381):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aligned Attention — Three.js</title>
<style>
* { box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #080d1a;
color: #eef3ff;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}
canvas {
display: block;
width: 100%;
height: 100%;
cursor: grab;
touch-action: none;
}
canvas.dragging { cursor: grabbing; }
.panel {
position: fixed;
z-index: 2;
top: 24px;
left: 24px;
max-width: min(380px, calc(100vw - 48px));
padding: 18px 20px;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 16px;
background: rgba(8, 13, 26, 0.62);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
backdrop-filter: blur(14px);
pointer-events: none;
}
.eyebrow {
display: flex;
align-items: center;
gap: 9px;
color: #72e8ff;
font-size: 11px;
font-weight: 750;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #65e9ff;
box-shadow: 0 0 14px #65e9ff;
}
h1 {
margin: 9px 0 6px;
font-size: clamp(25px, 4vw, 38px);
line-height: 1;
letter-spacing: -0.045em;
}
p {
margin: 0;
color: rgba(226, 235, 255, 0.68);
font-size: 13px;
line-height: 1.55;
}
.controls {
position: fixed;
z-index: 3;
right: 22px;
bottom: 20px;
display: flex;
align-items: center;
gap: 14px;
padding: 10px 12px 10px 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 999px;
background: rgba(8, 13, 26, 0.72);
color: rgba(230, 238, 255, 0.68);
font-size: 11px;
letter-spacing: 0.02em;
backdrop-filter: blur(12px);
}
button {
border: 0;
border-radius: 999px;
padding: 8px 12px;
background: rgba(255, 255, 255, 0.1);
color: white;
font: inherit;
font-weight: 700;
cursor: pointer;
}
button:hover { background: rgba(101, 233, 255, 0.2); }
@media (max-width: 600px) {
.panel { top: 14px; left: 14px; padding: 14px 16px; }
.controls {
right: 14px;
bottom: 14px;
left: 14px;
justify-content: space-between;
}
}
</style>
</head>
<body>
<canvas id="scene" aria-label="A stylized figure looking and pointing at the central cyan object"></canvas>
<section class="panel">
<div class="eyebrow"><span class="dot"></span> Three.js Study / 01</div>
<h1>Aligned attention</h1>
<p>
The figure’s gaze and extended index finger converge on the glowing
cyan focal object.
</p>
</section>
<div class="controls">
<span>Drag to orbit · Wheel/pinch to zoom</span>
<button id="reset" type="button">Reset view</button>
</div>
<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 resetButton = document.querySelector("#reset");
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(0x080d1a);
scene.fog = new THREE.Fog(0x080d1a, 13, 32);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
100
);
const clock = new THREE.Clock();
const Y_AXIS = new THREE.Vector3(0, 1, 0);
const FACE_FORWARD = new THREE.Vector3(0, 0, 1);
const view = {
yaw: 2.60,
pitch: 0.30,
radius: 10.5,
target: new THREE.Vector3(0, 1.25, 1.05)
};
const initialView = {
yaw: view.yaw,
pitch: view.pitch,
radius: view.radius
};
function updateCamera() {
const cosPitch = Math.cos(view.pitch);
camera.position.set(
view.target.x + view.radius * Math.sin(view.yaw) * cosPitch,
view.target.y + view.radius * Math.sin(view.pitch),
view.target.z + view.radius * Math.cos(view.yaw) * cosPitch
);
camera.lookAt(view.target);
}
// Lighting
scene.add(new THREE.HemisphereLight(0xb9dcff, 0x151126, 1.65));
const keyLight = new THREE.DirectionalLight(0xfff0dc, 3.1);
keyLight.position.set(-4, 8, 5);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -9;
keyLight.shadow.camera.right = 9;
keyLight.shadow.camera.top = 9;
keyLight.shadow.camera.bottom = -9;
keyLight.shadow.camera.near = 0.5;
keyLight.shadow.camera.far = 25;
scene.add(keyLight);
const rimLight = new THREE.DirectionalLight(0x667dff, 1.8);
rimLight.position.set(6, 5, -6);
scene.add(rimLight);
const warmLight = new THREE.PointLight(0xff8a45, 18, 8, 2);
warmLight.position.set(3, 2.8, 1.5);
scene.add(warmLight);
// Materials
const floorMaterial = new THREE.MeshStandardMaterial({
color: 0x0d1424,
roughness: 0.82,
metalness: 0.12
});
const pedestalMaterial = new THREE.MeshStandardMaterial({
color: 0x182238,
roughness: 0.42,
metalness: 0.48
});
const pedestalTopMaterial = new THREE.MeshStandardMaterial({
color: 0x263451,
roughness: 0.3,
metalness: 0.65
});
const jacketMaterial = new THREE.MeshStandardMaterial({
color: 0xf27945,
roughness: 0.7,
metalness: 0.02
});
const pantsMaterial = new THREE.MeshStandardMaterial({
color: 0x182039,
roughness: 0.76
});
const skinMaterial = new THREE.MeshStandardMaterial({
color: 0xf0b995,
roughness: 0.72
});
const hairMaterial = new THREE.MeshStandardMaterial({
color: 0x161728,
roughness: 0.9
});
const eyeMaterial = new THREE.MeshStandardMaterial({
color: 0xf7fbff,
roughness: 0.32
});
const pupilMaterial = new THREE.MeshBasicMaterial({
color: 0x111827
});
function addMesh(
geometry,
material,
position = [0, 0, 0],
parent = scene,
castShadow = true,
receiveShadow = false
) {
const mesh = new THREE.Mesh(geometry, material);
mesh.position.set(...position);
mesh.castShadow = castShadow;
mesh.receiveShadow = receiveShadow;
parent.add(mesh);
return mesh;
}
// Ground and circular stage
const ground = addMesh(
new THREE.PlaneGeometry(50, 50),
floorMaterial,
[0, -0.12, 0],
scene,
false,
true
);
ground.rotation.x = -Math.PI / 2;
const stage = addMesh(
new THREE.CylinderGeometry(5.65, 5.85, 0.15, 96),
new THREE.MeshStandardMaterial({
color: 0x101a2d,
roughness: 0.55,
metalness: 0.35
}),
[0, -0.055, 0],
scene,
false,
true
);
const stageRing = addMesh(
new THREE.TorusGeometry(5.63, 0.012, 8, 128),
new THREE.MeshBasicMaterial({
color: 0x426083,
transparent: true,
opacity: 0.42
}),
[0, 0.027, 0],
scene,
false
);
stageRing.rotation.x = Math.PI / 2;
function createPedestal(x, accent) {
const group = new THREE.Group();
group.position.x = x;
scene.add(group);
addMesh(
new THREE.CylinderGeometry(0.64, 0.73, 0.66, 48),
pedestalMaterial,
[0, 0.33, 0],
group
);
addMesh(
new THREE.CylinderGeometry(0.75, 0.79, 0.08, 48),
pedestalTopMaterial,
[0, 0.04, 0],
group
);
addMesh(
new THREE.CylinderGeometry(0.67, 0.67, 0.08, 48),
pedestalTopMaterial,
[0, 0.69, 0],
group
);
const ringMaterial = new THREE.MeshBasicMaterial({
color: accent,
transparent: true,
opacity: 0.9
});
const ring = addMesh(
new THREE.TorusGeometry(0.665, 0.018, 8, 64),
ringMaterial,
[0, 0.735, 0],
group,
false
);
ring.rotation.x = Math.PI / 2;
const accentMaterial = new THREE.MeshStandardMaterial({
color: accent,
emissive: accent,
emissiveIntensity: 1.8,
roughness: 0.35
});
addMesh(
new THREE.BoxGeometry(0.035, 0.28, 0.025),
accentMaterial,
[0, 0.36, 0.69],
group,
false
);
}
createPedestal(-2.6, 0xff5f9e);
createPedestal(0, 0x65e9ff);
createPedestal(2.6, 0xffc857);
// Object 1: pink cube
const cubeGroup = new THREE.Group();
cubeGroup.position.set(-2.6, 1.43, 0);
scene.add(cubeGroup);
const cubeMaterial = new THREE.MeshStandardMaterial({
color: 0xe84988,
emissive: 0x55112f,
emissiveIntensity: 0.7,
roughness: 0.3,
metalness: 0.32
});
const cube = addMesh(
new THREE.BoxGeometry(0.72, 0.72, 0.72),
cubeMaterial,
[0, 0, 0],
cubeGroup
);
const cubeEdges = new THREE.LineSegments(
new THREE.EdgesGeometry(cube.geometry),
new THREE.LineBasicMaterial({
color: 0xffa4ca,
transparent: true,
opacity: 0.75
})
);
cube.add(cubeEdges);
// Object 2: cyan focal object
const focalGroup = new THREE.Group();
focalGroup.position.set(0, 1.56, 0);
scene.add(focalGroup);
const focalMaterial = new THREE.MeshStandardMaterial({
color: 0x66eaff,
emissive: 0x087f9b,
emissiveIntensity: 1.5,
roughness: 0.12,
metalness: 0.15
});
addMesh(
new THREE.SphereGeometry(0.52, 48, 32),
focalMaterial,
[0, 0, 0],
focalGroup
);
const focalHalo = addMesh(
new THREE.SphereGeometry(0.66, 32, 24),
new THREE.MeshBasicMaterial({
color: 0x4be8ff,
transparent: true,
opacity: 0.075,
side: THREE.BackSide,
depthWrite: false
}),
[0, 0, 0],
focalGroup,
false
);
const focalWire = addMesh(
new THREE.IcosahedronGeometry(0.64, 1),
new THREE.MeshBasicMaterial({
color: 0xa6f7ff,
wireframe: true,
transparent: true,
opacity: 0.22,
depthWrite: false
}),
[0, 0, 0],
focalGroup,
false
);
const focalRingA = addMesh(
new THREE.TorusGeometry(0.73, 0.012, 8, 96),
new THREE.MeshBasicMaterial({
color: 0x79efff,
transparent: true,
opacity: 0.72
}),
[0, 0, 0],
focalGroup,
false
);
focalRingA.rotation.set(0.45, 0.2, 0.15);
const focalRingB = addMesh(
new THREE.TorusGeometry(0.79, 0.008, 8, 96),
new THREE.MeshBasicMaterial({
color: 0x5ab5ff,
transparent: true,
opacity: 0.4
}),
[0, 0, 0],
focalGroup,
false
);
focalRingB.rotation.set(1.1, -0.5, 0.4);
const focalLight = new THREE.PointLight(0x42dcff, 13, 5, 2);
focalGroup.add(focalLight);
// Object 3: golden torus
const torusGroup = new THREE.Group();
torusGroup.position.set(2.6, 1.48, 0);
scene.add(torusGroup);
const torusMaterial = new THREE.MeshStandardMaterial({
color: 0xffbd43,
emissive: 0x6d3700,
emissiveIntensity: 0.65,
roughness: 0.28,
metalness: 0.65
});
addMesh(
new THREE.TorusGeometry(0.46, 0.18, 20, 64),
torusMaterial,
[0, 0, 0],
torusGroup
);
addMesh(
new THREE.SphereGeometry(0.14, 20, 14),
new THREE.MeshStandardMaterial({
color: 0xffe3a2,
emissive: 0x8c5100,
emissiveIntensity: 1.1
}),
[0, 0, 0],
torusGroup
);
// Stylized figure
const figure = new THREE.Group();
figure.position.set(1.65, 0, 3.25);
scene.add(figure);
function setSegment(mesh, start, end) {
const direction = end.clone().sub(start);
const length = direction.length();
mesh.position.copy(start).add(end).multiplyScalar(0.5);
mesh.scale.set(1, length, 1);
mesh.quaternion.setFromUnitVectors(Y_AXIS, direction.normalize());
}
function addLimb(parent, start, end, radius, material) {
const limb = addMesh(
new THREE.CylinderGeometry(radius, radius, 1, 16),
material,
[0, 0, 0],
parent
);
setSegment(limb, start, end);
return limb;
}
// Legs and shoes
addLimb(
figure,
new THREE.Vector3(-0.24, 0.9, 0),
new THREE.Vector3(-0.24, 0.27, 0.02),
0.14,
pantsMaterial
);
addLimb(
figure,
new THREE.Vector3(0.24, 0.9, 0),
new THREE.Vector3(0.24, 0.27, 0.02),
0.14,
pantsMaterial
);
for (const x of [-0.24, 0.24]) {
const shoe = addMesh(
new THREE.SphereGeometry(1, 20, 14),
new THREE.MeshStandardMaterial({
color: 0x0c1222,
roughness: 0.65
}),
[x, 0.14, 0.13],
figure
);
shoe.scale.set(0.22, 0.14, 0.38);
}
const pelvis = addMesh(
new THREE.SphereGeometry(1, 24, 16),
pantsMaterial,
[0, 0.86, 0],
figure
);
pelvis.scale.set(0.43, 0.25, 0.29);
const torso = addMesh(
new THREE.SphereGeometry(1, 32, 22),
jacketMaterial,
[0, 1.34, 0],
figure
);
torso.scale.set(0.58, 0.76, 0.34);
// Jacket details, facing toward the objects.
addMesh(
new THREE.BoxGeometry(0.022, 0.56, 0.025),
new THREE.MeshStandardMaterial({
color: 0x743323,
roughness: 0.8
}),
[0, 1.33, -0.343],
figure
);
const badge = addMesh(
new THREE.CircleGeometry(0.075, 24),
new THREE.MeshStandardMaterial({
color: 0xffe0aa,
emissive: 0x7b4b1f,
emissiveIntensity: 0.25,
side: THREE.DoubleSide
}),
[-0.28, 1.54, -0.322],
figure
);
badge.rotation.y = Math.PI;
addMesh(
new THREE.CylinderGeometry(0.13, 0.15, 0.28, 20),
skinMaterial,
[0, 1.98, 0],
figure
);
// Head
const head = new THREE.Group();
head.position.set(0, 2.25, 0);
figure.add(head);
addMesh(
new THREE.SphereGeometry(0.38, 36, 24),
skinMaterial,
[0, 0, 0],
head
);
const hair = addMesh(
new THREE.SphereGeometry(
0.405,
32,
16,
0,
Math.PI * 2,
0,
Math.PI / 2
),
hairMaterial,
[0, 0.025, -0.015],
head
);
hair.scale.set(1.02, 0.98, 1.02);
for (const x of [-0.38, 0.38]) {
const ear = addMesh(
new THREE.SphereGeometry(0.09, 16, 12),
skinMaterial,
[x, -0.015, 0],
head
);
ear.scale.set(0.65, 1, 0.85);
}
const eyes = [];
for (const x of [-0.135, 0.135]) {
const eyeCenter = new THREE.Vector3(x, 0.065, 0.345);
const eye = addMesh(
new THREE.SphereGeometry(1, 18, 12),
eyeMaterial,
eyeCenter.toArray(),
head
);
eye.scale.set(0.13, 0.09, 0.055);
const pupil = addMesh(
new THREE.SphereGeometry(0.047, 14, 10),
pupilMaterial,
[x, 0.065, 0.408],
head,
false
);
pupil.scale.z = 0.45;
const glint = addMesh(
new THREE.SphereGeometry(0.011, 8, 6),
eyeMaterial,
[-0.012, 0.014, 0.018],
pupil,
false
);
eyes.push({ pupil, center: eyeCenter });
}
const nose = addMesh(
new THREE.SphereGeometry(0.07, 16, 12),
skinMaterial,
[0, -0.025, 0.407],
head
);
nose.scale.set(0.72, 0.9, 1);
const mouth = addMesh(
new THREE.TorusGeometry(0.105, 0.014, 8, 24, Math.PI),
new THREE.MeshStandardMaterial({
color: 0x8d4e49,
roughness: 0.8
}),
[0, -0.16, 0.375],
head
);
mouth.rotation.z = Math.PI;
// Relaxed arm
addLimb(
figure,
new THREE.Vector3(-0.58, 1.64, 0),
new THREE.Vector3(-0.72, 1.2, -0.08),
0.115,
jacketMaterial
);
addLimb(
figure,
new THREE.Vector3(-0.72, 1.2, -0.08),
new THREE.Vector3(-0.72, 0.88, -0.16),
0.09,
skinMaterial
);
const relaxedHand = addMesh(
new THREE.SphereGeometry(0.105, 16, 12),
skinMaterial,
[-0.72, 0.84, -0.16],
figure
);
relaxedHand.scale.set(0.9, 1.15, 0.85);
// Pointing arm
addLimb(
figure,
new THREE.Vector3(0.58, 1.64, 0),
new THREE.Vector3(0.72, 1.44, -1.05),
0.115,
jacketMaterial
);
addLimb(
figure,
new THREE.Vector3(0.72, 1.44, -1.05),
new THREE.Vector3(0.42, 1.56, -2.05),
0.09,
skinMaterial
);
const pointingHandLocal = new THREE.Vector3(0.42, 1.56, -2.05);
const pointingHand = addMesh(
new THREE.SphereGeometry(0.115, 16, 12),
skinMaterial,
pointingHandLocal.toArray(),
figure
);
pointingHand.scale.set(0.95, 0.85, 1.12);
// The finger's axis points directly at the focal object's center.
const pointingFinger = addMesh(
new THREE.CylinderGeometry(0.031, 0.027, 1, 14),
skinMaterial,
[0, 0, 0],
scene
);
// A subtle pool of light under the figure.
const figurePool = addMesh(
new THREE.CircleGeometry(1.15, 64),
new THREE.MeshBasicMaterial({
color: 0xff8a55,
transparent: true,
opacity: 0.045,
depthWrite: false
}),
[1.65, 0.012, 3.25],
scene,
false
);
figurePool.rotation.x = -Math.PI / 2;
// Custom camera controls: orbit, wheel zoom, and touch pinch.
const pointers = new Map();
let lastPinchDistance = 0;
function pointerDistance() {
const values = [...pointers.values()];
if (values.length < 2) return 0;
return Math.hypot(
values[0].x - values[1].x,
values[0].y - values[1].y
);
}
canvas.addEventListener("pointerdown", event => {
pointers.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
canvas.setPointerCapture(event.pointerId);
canvas.classList.add("dragging");
if (pointers.size === 2) {
lastPinchDistance = pointerDistance();
}
});
canvas.addEventListener("pointermove", event => {
const previous = pointers.get(event.pointerId);
if (!previous) return;
pointers.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
if (pointers.size === 1) {
const dx = event.clientX - previous.x;
const dy = event.clientY - previous.y;
view.yaw -= dx * 0.005;
view.pitch = THREE.MathUtils.clamp(
view.pitch + dy * 0.004,
0.08,
1.12
);
} else if (pointers.size === 2) {
const distance = pointerDistance();
if (lastPinchDistance > 0 && distance > 0) {
view.radius = THREE.MathUtils.clamp(
view.radius * (lastPinchDistance / distance),
5.5,
18
);
}
lastPinchDistance = distance;
}
});
function releasePointer(event) {
pointers.delete(event.pointerId);
lastPinchDistance = pointers.size === 2 ? pointerDistance() : 0;
if (pointers.size === 0) {
canvas.classList.remove("dragging");
}
}
canvas.addEventListener("pointerup", releasePointer);
canvas.addEventListener("pointercancel", releasePointer);
canvas.addEventListener("wheel", event => {
event.preventDefault();
view.radius = THREE.MathUtils.clamp(
view.radius * Math.exp(event.deltaY * 0.001),
5.5,
18
);
}, { passive: false });
resetButton.addEventListener("click", () => {
view.yaw = initialView.yaw;
view.pitch = initialView.pitch;
view.radius = initialView.radius;
});
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
});
const targetPosition = new THREE.Vector3();
const headWorldPosition = new THREE.Vector3();
const targetDirection = new THREE.Vector3();
const localDirection = new THREE.Vector3();
const parentQuaternion = new THREE.Quaternion();
const targetLocal = new THREE.Vector3();
const eyeDirection = new THREE.Vector3();
const handWorldPosition = new THREE.Vector3();
function animate() {
const time = clock.getElapsedTime();
// Gentle object motion.
cubeGroup.position.y = 1.43 + Math.sin(time * 0.95) * 0.075;
cubeGroup.rotation.x = time * 0.23;
cubeGroup.rotation.y = time * 0.38;
focalGroup.position.y = 1.56 + Math.sin(time * 1.35) * 0.045;
focalGroup.rotation.y = time * 0.32;
focalWire.rotation.x = time * 0.18;
focalWire.rotation.z = time * 0.13;
focalRingA.rotation.z = time * 0.42;
focalRingB.rotation.y = time * 0.31;
focalHalo.scale.setScalar(1 + Math.sin(time * 2.2) * 0.025);
torusGroup.position.y = 1.48 + Math.sin(time * 0.8 + 1.5) * 0.07;
torusGroup.rotation.x = Math.sin(time * 0.45) * 0.28;
torusGroup.rotation.y = time * 0.24;
figure.updateMatrixWorld(true);
focalGroup.getWorldPosition(targetPosition);
// Aim the head directly at the same object as the finger.
head.getWorldPosition(headWorldPosition);
targetDirection
.copy(targetPosition)
.sub(headWorldPosition)
.normalize();
figure.getWorldQuaternion(parentQuaternion);
localDirection
.copy(targetDirection)
.applyQuaternion(parentQuaternion.invert())
.normalize();
head.quaternion.setFromUnitVectors(FACE_FORWARD, localDirection);
head.updateMatrixWorld(true);
// Move each pupil toward the target in eye-local space.
targetLocal.copy(targetPosition);
head.worldToLocal(targetLocal);
for (const eye of eyes) {
eyeDirection.copy(targetLocal).sub(eye.center);
const length = Math.hypot(eyeDirection.x, eyeDirection.y);
if (length > 0.0001) {
eye.pupil.position.x =
eye.center.x + (eyeDirection.x / length) * 0.028;
eye.pupil.position.y =
eye.center.y + (eyeDirection.y / length) * 0.028;
}
eye.pupil.position.z = 0.408;
}
// The finger remains exactly aligned with the focal object's center.
handWorldPosition.copy(pointingHandLocal);
figure.localToWorld(handWorldPosition);
setSegment(pointingFinger, handWorldPosition, targetPosition);
updateCamera();
renderer.render(scene, camera);
}
updateCamera();
renderer.setAnimationLoop(animate);
</script>
</body>
</html>
```