Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(demos): register the meshopt decoder so every agent lab demo draws its 3D agent again, and make the wrecking-ball rope reach the button

nirholasa0b03a1ad82c
diff --git a/data/changelog.json b/data/changelog.json
index 5acb1bf3e..3b30ef1e6 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-10-10",
+ "title": "The 3D agent demos show their agent again",
+ "summary": "Every page in the agent interaction lab had stopped drawing its 3D character, so the demos showed only text and buttons. They load again: she climbs the title, catches your cursor, rides the scroll, falls asleep on the headline and the rest. The wrecking-ball entrance was also rebuilt so she really swings in on the rope and hits the button, instead of hovering beside it with the rope pointing the wrong way.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/demos/agents"
+ },
{
"date": "2026-10-10",
"title": "Approve or deny your agent's requests from Telegram and Discord",
diff --git a/public/demos/agents/_lib.js b/public/demos/agents/_lib.js
index 7fc56bdbd..4ce014354 100644
--- a/public/demos/agents/_lib.js
+++ b/public/demos/agents/_lib.js
@@ -4,6 +4,7 @@
import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
export const PX_PER_UNIT = 120;
@@ -55,10 +56,14 @@ export function createStage(canvas) {
return { renderer, scene, camera, resize, domToWorld };
}
+// Platform avatars ship EXT_meshopt_compression, which GLTFLoader refuses
+// to read without a decoder, so every demo loads through this.
+export function createGLTFLoader() {
+ return new GLTFLoader().setMeshoptDecoder(MeshoptDecoder);
+}
+
export async function loadAvatar(url = '/avatars/cz.glb') {
- const gltf = await new Promise((res, rej) =>
- new GLTFLoader().load(url, res, undefined, rej),
- );
+ const gltf = await createGLTFLoader().loadAsync(url);
const avatar = gltf.scene;
let rootBone = null;
avatar.traverse(n => {
diff --git a/public/demos/agents/auto-rig.html b/public/demos/agents/auto-rig.html
index 26bfea103..ccfe57523 100644
--- a/public/demos/agents/auto-rig.html
+++ b/public/demos/agents/auto-rig.html
@@ -250,7 +250,7 @@
<script type="module">
import * as THREE from 'three';
- import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+ import { createGLTFLoader } from './_lib.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { Client } from 'https://esm.sh/@gradio/[email protected]';
@@ -351,7 +351,7 @@
if (file.name.toLowerCase().endsWith('.glb')) {
const url = URL.createObjectURL(file);
try {
- const gltf = await new GLTFLoader().loadAsync(url);
+ const gltf = await createGLTFLoader().loadAsync(url);
viewerIn.setRoot(gltf.scene);
setStatus('Mesh loaded. Ready to rig.');
} catch (err) {
@@ -442,7 +442,7 @@
if (!finalFile?.url) throw new Error(finalStatus || 'Space returned no file.');
spinMsg.textContent = 'Loading rigged GLB…';
- const gltf = await new GLTFLoader().loadAsync(finalFile.url);
+ const gltf = await createGLTFLoader().loadAsync(finalFile.url);
// Add a skeleton helper so the new bones are visible
gltf.scene.traverse(o => {
diff --git a/public/demos/agents/face-mocap.html b/public/demos/agents/face-mocap.html
index 6a7bf4fce..804c4fd1a 100644
--- a/public/demos/agents/face-mocap.html
+++ b/public/demos/agents/face-mocap.html
@@ -405,9 +405,8 @@
<script type="module">
import * as THREE from 'three';
- import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { SkeletonHelper } from 'three';
- import { createStage, mountChrome } from './_lib.js';
+ import { createStage, createGLTFLoader, mountChrome } from './_lib.js';
import { FaceMocap } from '/src/face-mocap.js';
import { FaceMocapOverlay } from '/src/face-mocap-overlay.js';
@@ -436,9 +435,7 @@
});
}
- const gltf = await new Promise((res, rej) =>
- new GLTFLoader().load(url, res, undefined, rej),
- );
+ const gltf = await createGLTFLoader().loadAsync(url);
avatar = gltf.scene;
rootBone = null;
diff --git a/public/demos/agents/wrecking-ball.html b/public/demos/agents/wrecking-ball.html
index e4890bb4e..9ebae7adb 100644
--- a/public/demos/agents/wrecking-ball.html
+++ b/public/demos/agents/wrecking-ball.html
@@ -39,7 +39,7 @@
import {
createStage, loadAvatar, loadClips, startLoop,
fireSplash, fireShockwave,
- mountChrome,
+ mountChrome, PX_PER_UNIT,
} from './_lib.js';
mountChrome('Wrecking-ball entrance');
@@ -51,6 +51,10 @@
const stage = createStage(canvas);
const { avatar, mixer, rootBone, baseRootPos } = await loadAvatar();
stage.scene.add(avatar);
+ // Her body lies along the rope with her feet at its end, so the
+ // rope stops at the top of her head.
+ const box = new THREE.Box3().setFromObject(avatar);
+ const heightPx = (box.max.y - box.min.y) * PX_PER_UNIT;
const A = await loadClips(mixer, {
falling: '/animations/clips/falling.json',
@@ -61,15 +65,21 @@
A.falling.play();
let current = A.falling;
- // Pendulum: pivot at top-right, swings through a 100° arc.
- let phase = 'swing'; // swing → strike → recover → dangle
+ // Pendulum: the pivot sits up and to the right of the button, far
+ // enough out that the rope meets the button at about 45° below the
+ // pivot, and the rope is exactly long enough to reach it. She starts
+ // level with the pivot at the right edge and swings down into it.
+ let phase = 'swing'; // swing → recover → dangle
let pivotPx = { x: 0, y: 0 };
let length = 0;
let t0 = 0;
function recalc() {
- pivotPx = { x: window.innerWidth * 0.92, y: 60 };
- length = Math.min(window.innerHeight * 0.55, 460);
+ const c = ctaCenterPx();
+ const y = 60;
+ const x = Math.min(c.x + (c.y - y), window.innerWidth * 0.92);
+ pivotPx = { x, y };
+ length = Math.hypot(c.x - x, c.y - y);
}
recalc();
window.addEventListener('resize', recalc);
@@ -79,11 +89,12 @@
return { x: r.left + r.width / 2, y: r.top + r.height / 2 };
}
- // Map t∈[0,1] to a swing angle that starts horizontal-right (90°)
- // and decelerates into the strike at impact angle (≈ where the
- // pendulum reaches the CTA).
+ // Map t∈[0,1] to a swing angle that starts level to the right of
+ // the pivot and decelerates into the strike at the impact angle,
+ // where the end of the rope reaches the CTA. Angles are measured
+ // from straight down, positive to the right.
function swingAngle(t) {
- const start = -Math.PI / 2 + 0.4; // ~71° right of straight-down
+ const start = Math.PI / 2;
const end = computeImpactAngle();
const e = 1 - (1 - t) * (1 - t);
return start + (end - start) * e;
@@ -112,13 +123,14 @@
const py = pivotPx.y + Math.cos(angle) * length;
const w = stage.domToWorld(px, py);
avatar.position.set(w.x, w.y, 0);
- // Tilt the agent to match the rope direction.
- avatar.rotation.z = -angle;
- // Update rope visual.
+ // Tilt the agent so her head points up the rope at the pivot.
+ avatar.rotation.z = angle;
+ // Update rope visual. CSS rotates clockwise, which swings a
+ // downward rope to the left, hence the negated angle.
ropeEl.style.left = `${pivotPx.x}px`;
ropeEl.style.top = `${pivotPx.y}px`;
- ropeEl.style.height = `${length - 30}px`;
- ropeEl.style.transform = `rotate(${angle}rad)`;
+ ropeEl.style.height = `${Math.max(length - heightPx, 0)}px`;
+ ropeEl.style.transform = `rotate(${-angle}rad)`;
}
startLoop(stage.renderer, stage.scene, stage.camera, mixer, () => {