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: adjust minimum height and improve camera framing calculations for better visual alignment

nirholasd703bc4a00aa
diff --git a/src/element.js b/src/element.js
index dfa461985..951d0e061 100644
--- a/src/element.js
+++ b/src/element.js
@@ -165,7 +165,7 @@ const BASE_STYLE = `
position: sticky;
bottom: 0;
pointer-events: none !important;
- min-height: 180px;
+ min-height: 260px;
margin-top: auto;
z-index: 1;
}
@@ -1755,6 +1755,7 @@ class Agent3DElement extends HTMLElement {
if (this._chatAutoScroll) {
this._chatEl.scrollTop = this._chatEl.scrollHeight;
}
+ this._onStreamChunk();
}
});
}
@@ -1773,11 +1774,11 @@ class Agent3DElement extends HTMLElement {
t = this._bubbleBuffer;
}
- // Hard cap at 100 chars, break at last word boundary
- if (t.length > 100) {
- const truncated = t.slice(-90);
- const wordBreak = truncated.indexOf(' ');
- t = '…' + (wordBreak !== -1 ? truncated.slice(wordBreak) : truncated);
+ // Show the tail of the current text — reads as live speech being typed
+ if (t.length > 80) {
+ const tail = t.slice(-70);
+ const wordBreak = tail.indexOf(' ');
+ t = '…' + (wordBreak !== -1 ? tail.slice(wordBreak + 1) : tail);
}
this._thoughtTextEl.textContent = t;
diff --git a/src/viewer.js b/src/viewer.js
index 3614cecdd..125b6cb08 100644
--- a/src/viewer.js
+++ b/src/viewer.js
@@ -625,8 +625,8 @@ export class Viewer {
const vFovRad = this.defaultCamera.fov * (Math.PI / 180);
const aspect = Math.max(this.defaultCamera.aspect, 0.01);
const hFovRad = 2 * Math.atan(Math.tan(vFovRad / 2) * aspect);
- const distV = (bbSize.y / 2 * 1.15) / Math.tan(vFovRad / 2);
- const distH = (bbSize.x / 2 * 1.15) / Math.tan(hFovRad / 2);
+ const distV = (bbSize.y / 2 * 1.0) / Math.tan(vFovRad / 2);
+ const distH = (bbSize.x / 2 * 1.0) / Math.tan(hFovRad / 2);
const dist = Math.max(distV, distH);
// Orbital focus: 10% above bbox centre — upper-chest framing for humanoids.
@@ -637,12 +637,13 @@ export class Viewer {
if (this.options.cameraPosition) {
framedPos.fromArray(this.options.cameraPosition);
} else {
- // 3/4 angle: slight x offset for depth; z is the FOV-derived distance.
- framedPos.set(dist * 0.12, focusY, dist);
+ // 3/4 angle: shift target right so avatar sits left of centre in viewport.
+ const panX = dist * 0.18;
+ framedPos.set(dist * 0.12 + panX, focusY, dist);
}
const orbitalTarget = this.options.cameraPosition
? new Vector3()
- : new Vector3(0, focusY, 0);
+ : new Vector3(dist * 0.18, focusY, 0);
// In kiosk / embed modes (and on subsequent loads), snap straight to
// the framed position. On the first interactive load we tween in from