Skip to content

Fix face-tracking head tilt without changing yaw - #5

Merged
mekoand merged 1 commit into
livliv-dev:mainfrom
neverbiasu:codex/fix-tracking-roll-direction
Nov 7, 2026
Merged

mekoand merged 1 commit into
livliv-dev:mainfrom
neverbiasu:codex/fix-tracking-roll-direction

Conversation

@neverbiasu

Copy link
Copy Markdown
Contributor

Fixes #4. Head tilt was reversed for both mirror settings while yaw followed the documented direction. This converts filtered, calibrated roll to the player's Y-down convention when assigning angleZ; the existing yaw behavior and raw/stored calibration conventions are preserved.

Added eight regression cases covering both rotation signs and mirror settings, yaw/bodyX preservation, nonzero calibration, and mirror toggling. All eight fail on the old implementation with the opposite roll sign and pass with this fix. Generated matrices test the conversion boundary; they are not used as real-camera evidence.

Validation

Check Result
npm run check Passed
npm test 91 passed, 0 failed
npm run build Passed
npm run test:browser Passed: all 21 characters, including the React StrictMode case

Run with Node 22.22.2 and Playwright's matching Chromium headless build.

Personally tested with a real webcam, before and after

example/demo.html, Nana (d03ft), macOS 15.3, browser UA Chrome 156. Before-fix captures are in #4; after-fix captures and records are in the independent evidence commit.

mirror My physical motion Before After Expected
true Tilt toward my left shoulder Screen-right Screen-left Screen-left
false Tilt toward my left shoulder Screen-left Screen-right Screen-right
true Turn my face left (yaw control) Screen-left Screen-left Screen-left
false Turn my face left (yaw control) Screen-right Screen-right Screen-right

Head tilt: before / after

Setting Before After
mirror=true, tilt toward my left shoulder before-true-tilt-left after-true-tilt-left
mirror=false, tilt toward my left shoulder before-false-tilt-left after-false-tilt-left
Yaw controls and manual records
Setting After: turn my face left
mirror=true after-true-yaw-left
mirror=false after-false-yaw-left

Original after-fix record · Record with my subsequent confirmation · File hashes

The original after-fix JSON still labels the two mirror=true cases unclear. After testing, I explicitly confirmed all four cases were correct against the expected directions in the table above. The separate clarified record preserves that confirmation; the original export is unchanged. The before-fix record has its own clarification documented in #4.

The after-fix record's source-patch SHA-256 matches the source change in this PR. These are manual observations and timestamps, not MediaPipe face traces. Screenshots contain only the character canvas, with physical input directions attested by me. The real-camera captures cover leftward motions under both settings; both rotation signs are covered numerically.

The demo mirror toggle and calibrate/recenter controls requested in the issue are reserved for a separate PR.

@mekoand
mekoand merged commit 91cd1f7 into livliv-dev:main Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Face tracking: head tilt is reversed for both mirror settings, while yaw is correct

2 participants