# webxr-hand-tracking

Show the user's tracked hands (25 joints each) in a WebXR scene and detect a pinch, with a simulated hand outside a headset for testing

- **Space:** xr-glasses-and-headsets-public (https://github.com/Tech-Realm/space-xr-glasses-and-headsets-public/tree/main/webxr-hand-tracking)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, playwright-python, chromium
- **Routes:** static-local; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use xr-glasses-and-headsets-public/webxr-hand-tracking` or MCP `get_pack xr-glasses-and-headsets-public/webxr-hand-tracking`
- **Files:** CHANGELOG.md, code/hand.json, code/index.html, code/main.js, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal
Hand joints drawn every frame from `XRHand`, a pinch gesture (thumb tip to index tip under 2 cm) firing events, and the same code testable headless with recorded joint data.

## Steps
1. Request `hand-tracking` as an optional feature (see `webxr-session-starter`).
2. Each frame read 25 joint poses per hand with `frame.getJointPose` (three.js: `renderer.xr.getHand(i).joints`).
3. Pinch = distance(thumb-tip, index-finger-tip) < 0.02 m with hysteresis (release above 0.035 m).
4. Outside XR the page plays `fixtures/hand.json` (25 joints) through the same drawing and pinch code.
5. Check: `python3 ../tools/webgl_check.py code --js "window.__hand.joints === 25"`.

## Edge cases
- Joint order follows the WebXR Hand Input spec (wrist first, then thumb to little finger).
- Tracking drops when hands leave the cameras' view: fade joints instead of snapping.

## Don'ts
- Don't rely on hand tracking only: support controllers too.
- Don't store or upload raw hand data (biometric-like).



---

Canonical URL: https://logicpacks.io/packs/xr-glasses-and-headsets-public/webxr-hand-tracking

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
