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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(irl): pinch-to-resize in plain camera-mode AR
nirholas288239aead31
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a2b34722b..c206cce51 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **AR avatars now come alive in your room** — Avatars no longer land in AR as frozen statues. Every rigged avatar generated on three.ws now carries a Bring it to life link that opens IRL: the agent walks, animates, and talks with you through your camera, standing in your real space. Static placement is still one tap away for props or anyone who just wants the model on a desk. The living link ships everywhere avatars are made: the AR launch page, the 3D Studio tools in ChatGPT and Claude, and the developer MCP tools. (`/irl`) `[feature, improvement]`- **Docs catch-up: the social layer, living AR, and everything July shipped** — One documentation pass across everything that shipped this month. A new Social Layer guide covers the activity feed, follows, the notification bell, rankings, creator portfolios, and cross-entity search, and every one of those endpoints is now in the API reference. The AR docs caught up with reality: iPhone Quick Look now plays your avatar's idle animation (the old docs still said static pose), pinch-to-resize and the bring-it-to-life handoff are in the IRL guides, and the way shared AR links unfurl with a real model render is spelled out. Also new: how the prompt art director and the brand-mark lexicon make 3D generations cleaner, how ChatGPT generations stay fast under load, Sketchfab showcase states, and premium key management. (`/docs/social-layer`) `[docs]`- **iPhone AR placement now hands you back to the pin** — On iPhone, placing an agent in AR opens Apple's Quick Look viewer, which is sealed: the page can't put buttons inside it. It does allow one banner, and that banner is now wired: it shows your agent's name in the AR view, and tapping it brings you back to IRL with the Pin here button pulsing, so the exact spot you liked in AR becomes a durable pin other people can walk up to, in one tap. (`/irl`) `[improvement]`+- **Pinch-to-resize now works in plain camera AR too** — Two-finger pinch-to-resize was already live in the WebXR floor-anchor flow (Chrome for Android); it now works the same way in plain camera-mode AR, including iOS Safari's Pin here path. Pinch before or after placing your agent, from a desk figurine to a statue, and the size saves to the pin so everyone nearby sees it exactly as big as you left it. (`/irl`) `[improvement]`- **Shared AR links now unfurl with the model itself** — Paste a place-in-your-room link into a chat and it now shows a real rendered picture of that exact model instead of a bare URL. The AR page also shows the model's name, a proper loading state, and a Create your own link, so a friend who receives a model can make one of their own in a tap. Behind it, the public model renderer gained a URL form: point any image tag at /api/render/glb with a public GLB link and get a PNG back. (`/ar`) `[improvement]`- **The ChatGPT AR pipeline, fully documented** — New docs tell the whole story of how a sentence typed into ChatGPT becomes a 3D model standing in your room: the free generation lane ChatGPT calls, the one-tap AR link every generation carries, what happens on iPhone, Android, and a computer when you open it, and how a shared link unfurls with a real render of the model. A companion tutorial walks a first-timer from their first prompt to a model on their desk in about five minutes. (`/docs/chatgpt-ar`) `[docs]`diff --git a/data/changelog.json b/data/changelog.jsonindex 17a5a0fda..1c2724533 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. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-15",+ "title": "Pinch-to-resize now works in plain camera AR too",+ "summary": "Two-finger pinch-to-resize was already live in the WebXR floor-anchor flow (Chrome for Android); it now works the same way in plain camera-mode AR, including iOS Safari's Pin here path. Pinch before or after placing your agent, from a desk figurine to a statue, and the size saves to the pin so everyone nearby sees it exactly as big as you left it.",+ "tags": [+ "improvement"+ ],+ "link": "/irl"+ },{"date": "2026-07-15","title": "iPhone AR placement now hands you back to the pin",diff --git a/docs/irl.md b/docs/irl.mdindex fc569624f..9dd41e4b6 100644--- a/docs/irl.md+++ b/docs/irl.md@@ -31,7 +31,7 @@ Everything below is live on [/irl](/irl) and exposed by the [`@three-ws/irl`](htOpen /irl on your phone, pick one of your agents (or try it anonymously), and drop a pin:- **Place in AR** is the flagship path on devices with a real AR surface. On Chrome for Android (ARCore) a WebXR hit-test reticle finds the floor; tap to anchor the agent to the detected surface, then **pinch with two fingers to resize it** — from a desk figurine (25%) to a statue (400%). The placement and the chosen size both save to the pin, so everyone nearby sees the agent exactly where and how big you left it. On iOS the same button opens the agent in ARKit Quick Look **with its idle animation baked into the USDZ**, so it breathes and sways in your room instead of standing in a frozen pose. Quick Look is Apple's sealed viewer (no page UI can live inside it), but its one sanctioned hook is wired: a banner at the bottom names the agent, and tapping it hands you back to /irl with **Pin here** pulsing, so the spot you liked in AR becomes a durable pin in one tap. Apple's native pinch-to-resize works inside Quick Look too, though that size is per-session: the size everyone else sees is the pin's saved one. This button leads the dock whenever the device supports it.-- **Pin here** places it at your current GPS spot using the camera and gyroscope. Works on every supported phone, including iOS Safari.+- **Pin here** places it at your current GPS spot using the camera and gyroscope. Works on every supported phone, including iOS Safari. Same two-finger pinch as the WebXR path resizes it (25%–400%), before or after placing, and the size saves to the pin so nearby viewers see it exactly as big as you left it.- **Place on map** puts an agent somewhere you are not currently standing.Anonymous pins work immediately from a device token and expire after 7 days. Signed-in pins are permanent until you remove them. The full walkthrough is in [Place a 3D agent in your real environment](/docs/tutorials/place-agent-irl).diff --git a/public/changelog.json b/public/changelog.jsonindex f46efedf8..071e74999 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-15T12:03:37.462Z",+ "generated_at": "2026-07-15T16:34:23.253Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -77,6 +77,16 @@"improvement"]},+ {+ "date": "2026-07-15",+ "type": "update",+ "title": "Pinch-to-resize now works in plain camera AR too",+ "summary": "Two-finger pinch-to-resize was already live in the WebXR floor-anchor flow (Chrome for Android); it now works the same way in plain camera-mode AR, including iOS Safari's Pin here path. Pinch before or after placing your agent, from a desk figurine to a statue, and the size saves to the pin so everyone nearby sees it exactly as big as you left it.",+ "link": "/irl",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-07-15","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 34624c60a..aaae9bc6b 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -62,6 +62,14 @@<category>improvement</category><description>On iPhone, placing an agent in AR opens Apple's Quick Look viewer, which is sealed: the page can't put buttons inside it. It does allow one banner, and that banner is now wired: it shows your agent's name in the AR view, and tapping it brings you back to IRL with the Pin here button pulsing, so the exact spot you liked in AR becomes a durable pin other people can walk up to, in one tap.</description></item>+ <item>+ <title>Pinch-to-resize now works in plain camera AR too</title>+ <link>https://three.ws/irl</link>+ <guid isPermaLink="false">2026-07-15:Pinch-to-resize now works in plain camera AR too</guid>+ <pubDate>Wed, 15 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Two-finger pinch-to-resize was already live in the WebXR floor-anchor flow (Chrome for Android); it now works the same way in plain camera-mode AR, including iOS Safari's Pin here path. Pinch before or after placing your agent, from a desk figurine to a statue, and the size saves to the pin so everyone nearby sees it exactly as big as you left it.</description>+ </item><item><title>Shared AR links now unfurl with the model itself</title><link>https://three.ws/ar</link>diff --git a/public/features.json b/public/features.jsonindex 7547534d2..5dae54b4d 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-15T12:03:37.446Z",+ "generated_at": "2026-07-15T16:34:23.239Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/ar/pinch-scale.js b/src/ar/pinch-scale.jsindex 15a161dc4..c3e4193fb 100644--- a/src/ar/pinch-scale.js+++ b/src/ar/pinch-scale.js@@ -84,3 +84,17 @@ export function clampPinScale(v) {if (!Number.isFinite(n) || n <= 0) return 1;return Math.min(PINCH_SCALE_MAX, Math.max(PINCH_SCALE_MIN, n));}++/**+ * Euclidean distance between two touch points, in CSS pixels — the raw+ * geometry both AR pinch lanes (WebXR's dom-overlay and camera-mode's plain+ * canvas) feed into pinchStart/pinchMove.+ *+ * @param {TouchList|Touch[]} touches+ * @returns {number}+ */+export function touchDist(touches) {+ const dx = touches[0].clientX - touches[1].clientX;+ const dy = touches[0].clientY - touches[1].clientY;+ return Math.hypot(dx, dy);+}diff --git a/src/ar/webxr.js b/src/ar/webxr.jsindex 0d279a093..21db77781 100644--- a/src/ar/webxr.js+++ b/src/ar/webxr.js@@ -17,7 +17,7 @@ import {advancePulse, isXrVisible, nextTrackingState, reticleVisual, TRACKING_LOSS_FRAMES,} from './anchor-lifecycle.js';import { DepthOcclusion } from './depth-occlusion.js';-import { createPinchState, pinchEnd, pinchMove, pinchStart } from './pinch-scale.js';+import { createPinchState, pinchEnd, pinchMove, pinchStart, touchDist } from './pinch-scale.js';/** prefers-reduced-motion: calm, static reticle/confirm states when set. */function _prefersReducedMotion() {@@ -371,21 +371,15 @@ export class WebXRSession {// Raw touch geometry → the pure pinch state machine → a uniform scale on the// content group (and its contact shadow, so the grounding grows with it).- static _touchDist(touches) {- const dx = touches[0].clientX - touches[1].clientX;- const dy = touches[0].clientY - touches[1].clientY;- return Math.hypot(dx, dy);- }-_handleTouchStart(e) {if (e.touches.length !== 2) return;const base = this._viewer.content?.scale?.x ?? 1;- pinchStart(this._pinch, WebXRSession._touchDist(e.touches), base);+ pinchStart(this._pinch, touchDist(e.touches), base);}_handleTouchMove(e) {if (!this._pinch.active || e.touches.length !== 2) return;- const s = pinchMove(this._pinch, WebXRSession._touchDist(e.touches));+ const s = pinchMove(this._pinch, touchDist(e.touches));if (s == null) return;this._applyContentScale(s);this._onScale?.(s, { final: false });diff --git a/src/irl.js b/src/irl.jsindex 568d97e9c..584611ef5 100644--- a/src/irl.js+++ b/src/irl.js@@ -43,7 +43,9 @@ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';import nipplejs from 'nipplejs';import { AnimationManager } from './animation-manager.js';import { WebXRSession } from './ar/webxr.js';-import { clampPinScale } from './ar/pinch-scale.js';+import {+ clampPinScale, createPinchState, pinchEnd, pinchMove, pinchStart, touchDist,+} from './ar/pinch-scale.js';import { resolvePlacementCapability } from './ar/placement-capability.js';import { openQuickLook } from './ar/quick-look.js';import { withQuickLookBanner } from './ar/quicklook-banner.js';@@ -799,6 +801,9 @@ canvas.addEventListener('pointerdown', e => {// The WebXR floor-anchor session (and its failed-start error card) layers a modal// overlay over the canvas; don't arm a long-press behind it.if (xrOverlay && !xrOverlay.hidden) return;+ // A camera-mode pinch owns both fingers — the second finger's pointerdown is+ // never the start of a long-press.+ if (camPinchBlocking()) return;tapDownX = e.clientX; tapDownY = e.clientY; armLongPress(e);});canvas.addEventListener('pointerup', e => {@@ -809,6 +814,9 @@ canvas.addEventListener('pointerup', e => {// stray sheets). The overlay is display:none whenever AR/gyro mode is active, so// this only gates during an actual XR session or its error state.if (xrOverlay && !xrOverlay.hidden) return;+ // A pinch (or a finger lifting right after one) is never a tap — mirrors the+ // WebXR session's own _handleBeforeSelect debounce.+ if (camPinchBlocking()) return;// While calibrating, taps belong to the nudge gesture — never re-open a sheet.if (calibrateActive) return;if (Math.hypot(e.clientX - tapDownX, e.clientY - tapDownY) > TAP_THRESHOLD) return;@@ -935,11 +943,59 @@ window.addEventListener('keyup', e => {}});+// ── Pinch-to-resize (camera-mode AR, no WebXR) ────────────────────────────+// The WebXR floor-anchor lane has had two-finger pinch-resize since its own+// session controller (src/ar/webxr.js) shipped; plain camera-mode AR (no+// device support for immersive-ar, or the user never opened the floor-anchor+// flow) never got the gesture. Same pure state machine, but there's no XR+// content group to scale here — it drives avatarRig directly, since the+// owner's own AR avatar renders through avatarRig, not as one of nearbyPins+// (savePin's local pin literal never spawns a group for the owner's own pin).+// A short post-pinch debounce (mirroring WebXRSession's _handleBeforeSelect)+// keeps the second finger's lift from misfiring drag-to-orbit or a tap.+const _camPinch = createPinchState();+let _camScale = 1;+let _camPinchEndedAt = -Infinity;+function camPinchBlocking() {+ return _camPinch.active || performance.now() - _camPinchEndedAt < 350;+}+canvas.addEventListener('touchstart', e => {+ if (!arActive || xrSession || calibrateActive || placeModeActive) return;+ if (e.touches.length !== 2) return;+ pinchStart(_camPinch, touchDist(e.touches), avatarRig.scale.x);+}, { passive: true });+canvas.addEventListener('touchmove', e => {+ if (!_camPinch.active || e.touches.length !== 2) return;+ const s = pinchMove(_camPinch, touchDist(e.touches));+ if (s == null) return;+ _camScale = s;+ avatarRig.scale.setScalar(s);+ setStatus(`Size ${Math.round(s * 100)}% — pinch to resize`);+}, { passive: true });+canvas.addEventListener('touchend', () => {+ const s = pinchEnd(_camPinch);+ if (s == null) return;+ _camPinchEndedAt = performance.now();+ _camScale = s;+ if (!gpsPin?.id) {+ setStatus(`Size ${Math.round(s * 100)}% — tap Pin here to save your agent at this size`);+ return;+ }+ fetch('/api/irl/pins', {+ method: 'PATCH', credentials: 'include',+ headers: deviceHeaders({ 'Content-Type': 'application/json' }),+ body: JSON.stringify({ id: gpsPin.id, deviceToken: _deviceToken, scale: s }),+ }).then(r => {+ if (!r.ok) { setStatus('Size couldn’t be saved, pinch again to retry', { error: true }); return; }+ setStatus(`Saved at ${Math.round(s * 100)}% size — nearby viewers see it this big too`);+ }).catch(() => setStatus('Size couldn’t be saved (offline?), pinch again to retry', { error: true }));+}, { passive: true });+// ── Drag-to-orbit (disabled in place mode so taps don't orbit) ───────────{let dragging = false, lastX = 0, lastY = 0, downId = -1;canvas.addEventListener('pointerdown', e => {- if (placeModeActive || calibrateActive) return;+ if (placeModeActive || calibrateActive || camPinchBlocking()) return;// Don't orbit the (paused, hidden) IRL camera behind the WebXR overlay.if (xrOverlay && !xrOverlay.hidden) return;const r = joystickEl.getBoundingClientRect();@@ -951,6 +1007,9 @@ window.addEventListener('keyup', e => {// Calibration may engage mid-drag (long-press fires while still held) — yield// the pointer to the nudge gesture instead of orbiting the camera.if (calibrateActive) { dragging = false; return; }+ // A second finger landing mid-drag turns this into a pinch — the first+ // finger's already-armed drag must yield instead of also panning the camera.+ if (camPinchBlocking()) { dragging = false; return; }if (!dragging || e.pointerId !== downId) return;cameraYaw -= (e.clientX - lastX) * 0.005;cameraPitch = Math.max(PITCH_MIN, Math.min(PITCH_MAX, cameraPitch - (e.clientY - lastY) * 0.0035));@@ -1002,6 +1061,10 @@ function _clearAvatar() {disposeObject3D(avatar);avatar = null;}+ // A freshly swapped-in avatar starts at natural size — the old one's+ // pinch-resize (camera-mode AR) shouldn't carry over onto a different model.+ _camScale = 1;+ avatarRig.scale.setScalar(1);}// Attach the embodied-finance glow to the carried avatar and start its live feed.@@ -1407,6 +1470,10 @@ async function setLocked(next) {}gpsPin = null;gpsModeActive = false;+ // Unpinning deletes the placement outright — the next "Pin here" is a+ // fresh session, so the pinch-resize resets to natural size with it.+ _camScale = 1;+ avatarRig.scale.setScalar(1);}}// In AR the lock path owns its own status — the deferred-GPS "Waiting…",@@ -2272,6 +2339,9 @@ async function savePin(lat, lng, heading = 0, caption = '', anchor = null, placegpsAccuracyM: src === 'map' ? null : gpsState.accuracy,altitudeM: src === 'map' ? null : gpsState.altitude,source: src,+ // Pinch-resized size (camera-mode AR, mirrors the WebXR anchor.scale) —+ // omitted at natural scale so a plain placement stays byte-identical.+ scale: Number.isFinite(a.scale) && a.scale !== 1 ? a.scale : undefined,};const r = await fetch('/api/irl/pins', {method: 'POST',@@ -2658,7 +2728,9 @@ function commitPin(pinLat, pinLng, headingDeg, caption, source = 'gyro-gps') {// yawDeg is the absolute compass heading; source carries the absolute-vs-relative// distinction ('gyro-gps' | 'gyro-gps:rel') for A3. accuracy / altitude are filled// from the live GPS fix inside savePin().- const anchor = { heightM: 0, yawDeg: headingDeg, source };+ // scale: any camera-mode pinch that happened before "Pin here" rides straight+ // into the placement instead of requiring a separate PATCH after the fact.+ const anchor = { heightM: 0, yawDeg: headingDeg, source, scale: _camScale };// Tell the truth about precision: a noisy fix (>25 m) is an approximate spot, not a// pinpoint. The exact metres ride the stored gpsAccuracyM (savePin); here we surface// a subtle note so the success copy never implies more accuracy than the fix had.