Repository navigation
Fix face-tracking head tilt without changing yaw - #5
Merged
mekoand merged 1 commit intoNov 7, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
npm run checknpm testnpm run buildnpm run test:browserRun 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.Head tilt: before / after
mirror=true, tilt toward my left shouldermirror=false, tilt toward my left shoulderYaw controls and manual records
mirror=truemirror=falseOriginal after-fix record · Record with my subsequent confirmation · File hashes
The original after-fix JSON still labels the two
mirror=truecasesunclear. 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.