The camera is the viewer's eye: how a slime blob knows where you are without a webcam
Mintie contributors
core stack 2026-10-31
Mintie is a talking slime blob that runs in a browser tab (live demo: move your pointer around and watch the eyes). Mintie should look at you: eyes that find you, a body that turns toward you when you speak, a glance that drifts away when they get shy. The choice at the center of this post: Mintie is aware of the in-scene camera, not of a webcam.
Numbers come from the code at the release commit or are derived from it; measurements are labeled. We ran no user study. "Feels like it is looking at you" is our judgment, not data.

Why not a webcam
A webcam would tell us where your face is. We did not build that, for three reasons.
1.
Privacy. A mascot that watches you through your camera is a hard sell. The only getUserMedia call in the web client (web/voice.js) asks for the microphone.
2.
Permission friction. A second prompt for a decorative feature costs more trust than it earns.
3.
It is unnecessary. The scene already has a viewer. It is the render camera. Everything you see is drawn from that point, so a character that looks at that point is looking at your eye, as far as the picture is concerned.
The camera as a character in the world
We treat the camera as a person standing in Mintie's world. It sits at a fixed azimuth of -35 degrees and elevation of 20 degrees around a target near Mintie, at a distance that depends on zoom, and Mintie knows that position. The camera target trails Mintie across the floor (a 350 ms time constant, 240 ms while hopping), so when Mintie hops, the viewer's bearing shifts for a moment and Mintie turns to keep facing it.
side view (y up)
camera = the viewer's eye (C)
C ---- pointer offset (right/up of C's own axes, up to 2.4 world units) ---> T (gaze target)
\
\ line of sight, 20 degrees above the horizon
\
o Mintie (eyes ~0.65 above the floor point)
pointer at screen center: T = C, so Mintie looks straight down the line of sight.
Zoom is a dolly, not a field-of-view change. A zoom factor between 0.6x and 1.6x divides the framed distance (so 1.6x is closer, 0.6x is farther), and the factor follows its target on a critically damped spring with a 160 ms smoothing time. The viewer walks closer and farther, and Mintie can notice.

The math
The gaze target is the camera position plus an offset in the camera's right/up plane. The offset comes from the cursor or touch position, normalized so screen center is (0, 0) and the edges are ±1.
// adapted from web/character/view.js
const GAZE_SPREAD = 2.4; // world units
const gazeTarget = (position, right, up, nx = 0, ny = 0, spread = GAZE_SPREAD) =>
position.map((p, i) =>
p + (right[i] * clamp(nx, -1, 1) + up[i] * clamp(ny, -1, 1)) * spread);
The code is web/character/view.js. Three properties matter.
Center is exactly the camera. With the pointer at (0, 0) the offset is zero, so the target equals the camera position. A unit test asserts exact equality. A user who never moves the mouse gets eye contact aimed at the camera (plus the small saccades described below).
The offset is bounded. nx and ny are clamped to ±1, and non-finite input falls back to 0.
The spread is in world units, not degrees. A fixed 2.4-unit offset subtends a different angle depending on camera distance. At the default 7-unit distance, the right edge of the screen is atan(2.4 / 7), about 18.9 degrees off the line to the camera. Zoomed in to 1.6x (distance 4.375) that grows to about 28.7 degrees; zoomed out to 0.6x (distance 11.67) it shrinks to about 11.6 degrees. Derived from the constants for a pure horizontal offset in a landscape window; narrow portrait windows frame farther back. Zoom in and Mintie's eyes swing wider to follow your cursor. Zoom out and the gaze becomes more composed. Nobody tuned that; it falls out of the geometry, and a test pins the ordering.

The cursor feeds the gaze through its own critically damped spring (140 ms smoothing time), so a cursor that jumps across the window produces a glide, not a snap. Leaving the window, blurring it, or lifting a finger on a touch screen sets the pointer back to (0, 0), and the eyes ease back to the camera.
Eyes lead, body follows
Gaze shifts start in the eyes; the head follows. Two filters, two speeds (both in web/perform/engine.js).
•
Eyes: a critically damped spring, 70 ms smoothing time. By the standard formula it reaches about 95% of a step in roughly 165 ms (derived).
•
Body yaw: an exponential follow with a 240 ms time constant, about 720 ms to 95% (derived). In the code this is a first-order lag, not a second-order spring.
The eye target is computed against the body's current heading, not the world: angle(targetYaw - FACE_YAW - bodyYaw). As the body catches up, the residual shrinks and the eyes drift back to center. The pointer turns the body only half of the way (AMBIENT_FOLLOW = 0.5); the eyes take the rest. When Mintie is listening or talking, the body faces the camera fully and the pointer is ignored: eye contact wins.
Why critical damping
The spring uses Unity's SmoothDamp form:
// adapted from web/character/view.js
function damp(s, target, smoothTime, dt) {
const w = 2 / smoothTime, x = w * dt;
const e = 1 / (1 + x + .48 * x * x + .235 * x * x * x);
const change = s.x - target, temp = (s.v + w * change) * dt;
s.v = (s.v - w * temp) * e;
s.x = target + (change + temp) * e;
return s.x;
}
Critical damping gives no overshoot (an eye that overshoots reads as a tic), continuous velocity (a cursor jump moves the target, never the velocity), and frame-rate independence. A test runs it at 240, 60 and 20 steps per second and checks for overshoot. An underdamped spring would add a bounce we would then have to suppress.
The FACE_YAW bug
The face is not centered on the body. The eye midpoint sits about 20 degrees to the right of the body's forward axis (FACE_YAW = 20 degrees, pinned by a test to the eye normals computed from the body shape: about 8.4 and 31.5 degrees for the left and right eye). Our first version aimed the body's forward axis at the camera. The result: the body faced the camera while the face, built 20 degrees off that axis, pointed away from it.
The fix is one subtraction: yaw the body by viewerYaw - FACE_YAW, so the face, not the axis, points at the target. A test asserts the settled body twist equals the viewer yaw minus FACE_YAW within 0.015 rad.
A related error sat at the eye level: each eye's rest normal is yawed outward by its own amount, so eye-local gaze 0 was not camera-facing either. Per-eye aim offsets (EYE_AIM) fix it: each eye is turned by the difference between FACE_YAW and its own normal's yaw. In the release that comes to about +11.6 degrees for the left eye and -11.5 for the right (derived from the eye normals above).
Saccades and micro-drift
A steady eye looks dead. On top of the spring target:
•
Fixational saccades. Every 0.5 to 2.5 s a random small jump: usually up to ±0.05 in gaze units horizontally (about ±1.9 degrees, derived, since one gaze unit is 0.65 rad), and 18% of the time a larger one up to ±0.15 (about ±5.6 degrees). The spring smooths them into flicks the code comment puts near 80 ms.
•
Micro-drift. Two summed sines per axis, with a combined peak of about 0.017 gaze units horizontally and 0.014 vertically (under a degree, derived).
Both are seeded, so tests are repeatable.
Handing control to physics
When you grab or throw Mintie, physics wants to own orientation. The viewer-facing yaw is the largest authored angle in the pose (the code comment says about 55 degrees, which is what the default camera produces), and handing it over in one frame is a visible pop.
The body therefore keeps a "touch weight" (web/character/body.js): 1 while held or falling (not while hopping), held for 400 ms after landing, then released over 180 ms. The authored yaw is multiplied by one minus a yaw weight that rises over 160 ms and falls with the touch weight. The camera target also stops following Mintie while it is held, poked, patted or petted, so the drag plane does not move under your finger.
Hops are voluntary physics and need a different hand-off (web/touch.js). A smoothstep ramp over 300 ms blends body yaw from "facing the viewer" to "facing the direction of travel", and after landing the blend decays with a 220 ms time constant. We measured the effect as the largest per-frame change at a fixed 60 fps timestep. "Before" is the repository's baseline import (10adfb9), before viewer awareness; "after" is 2808d45, whose view, body, engine and touch modules are byte-identical to the release. The run is a deterministic Node simulation of each build's real engine, touch and body modules, so all three repetitions came out identical. Onset is the maximum over all 64 catalog emotes.
Channel (max change per frame)
Before
After
Emote onset gaze-Y
0.292
0.073
Hop yaw hand-off (same camera for both builds)
0.746 rad in one frame
0.241 rad/frame peak in the first 300 ms (0.266 later in the hop)
Throw/land body yaw (same camera for both builds)
0.611 rad
0.413 rad
These are simulated, not read from a live page. The simulation leaves out the needs system, touch events and the speech realizer. The hop row needs a caveat: the baseline camera had no viewer-facing yaw to hand off, and with its own camera its hop step was 0.206 rad. The 0.746 is what a viewer-facing yaw costs without the hand-off. Idle eye motion goes up (over 30 s of idle, gaze-X max step 0.010 to 0.027), on purpose, because the eyes now track the viewer and make saccades. Not everything improved: the worst-case lean when one emote preempts another went only from 0.113 to 0.091, and cancelling every emote at +600 ms left mouth, smile, squash, puff and lean unchanged (only gaze-Y moved, 0.082 to 0.036). We did not measure other cancel times.
Reduced motion
If the OS asks for reduced motion, Mintie's body does not turn toward the viewer at all, and the eyes carry the whole angle instead, up to their limit of ±0.9 gaze units (about 34 degrees). At the default camera the angle needed is about 55 degrees (derived), so the eyes turn toward you as far as they can reach but fall short of the camera. Saccade and drift amplitude scale by 0.35, as does the body lean from pitch. Idle hops are disabled. Awareness survives in reduced form: the eyes still look your way, and the character does not swing.
What the decider knows
Looking at you is local. Deciding what to do about you is the System One decider's job (the typed-judgment layer from our post "A fast typed decision beside the LLM: how Mintie's voice loop avoids waiting for words"), and it needs to know where you are. Each request to the server carries a scene.viewer object computed from the camera position and Mintie's center of mass (sceneState() in web/main.js):
•
bearing: one of eight octants (front, front-right, ... front-left) of the camera around Mintie, in the world frame. It is not relative to Mintie's heading.
•
distanceH: the 3D distance to the camera, in world units.
•
aboveDeg: elevation of the camera above Mintie, in degrees.
The server validates the shape (server/server.mjs: bearing from the eight values, aboveDeg within ±90, distance at most 200) and passes the object into the model state as state.scene. Touch observations are written from your point of view: a drag vector is rotated by the bearing, so the decider reads "dragged 0.6 H to your left" rather than world coordinates (0.6 is illustrative). The hand-written server code that interprets the viewer object is that drag sentence, and it reads only bearing (server/jev.mjs); distance and elevation reach the model as data. On the client, the decider's hop replies (toward_viewer, away_from_viewer, left, right) are resolved against the camera position, so "come closer" means closer to your eye.
The gaze question tells the decider: "Eye contact is deliberate, not cursor following." The pointer offset is not sent. The decider chooses among viewer, away, down, up, touch or no change, and the local gaze loop does the rest. Shyness and dreamy remembering can look away for 2.5 s, then the camera pulls the eyes back.
What we would try next
•
Orbit. The camera is fixed in azimuth and elevation, with dolly only, so the bearing changes only when Mintie moves relative to the camera target. An orbiting viewer would make it change constantly, and we would need to test the eyes and the decider's bearing words under that.
•
A neck. We yaw the whole body and aim two eyes. A neck rig would let the head turn faster than the body, which is what people do.
•
Perception test. We believe an eye aimed at the camera reads as eye contact, but have not tested it. A small A/B of camera-aimed against cursor-aimed would show whether the pointer offset helps or feels busy.
•
Touch gaze. A phone has no cursor between touches, so the offset releases when a finger lifts. Glancing at the last touch point is cheap to try.
•
Reduced-motion reach. With the body held still, the eyes cannot reach the default camera angle. A smaller body turn, or a wider eye range, would close the gap.
The code is at github.com/tommyyzhao/mintie-mascot, with the gaze math in web/character/view.js and the eye and body logic in web/perform/engine.js.