Used WebXR immersive-ar as an absolute pointing device for a desktop — two-ray corner calibration, One Euro filter, WebRTC to the PC
▲ 7 r/WebXR

Used WebXR immersive-ar as an absolute pointing device for a desktop — two-ray corner calibration, One Euro filter, WebRTC to the PC

A slightly unusual application of immersive-ar: rather than rendering anything, I'm using the WebXR pose purely as a tracking source to drive a desktop mouse cursor absolutely — a software lightgun for PC rail shooters like Time Crisis.

The parts that might interest this sub:

Two-ray corner calibration. The user points at three screen corners; two rays per corner define the screen plane without needing hit-test or surface tracking, so it works on any display — no markers, no QR targets stuck to the monitor. WebXR anchors then keep the calibration self-correcting as ARCore refines its map of the room.

Zero certificates for the wireless flow. This is normally the worst part of any local WebXR project. Here the phone page is served over HTTPS from GitHub Pages, signaling is a single Local Network Access fetch (Chrome 142+), and WebRTC brings its own encryption. Run an executable on the PC, it prints a QR, you scan it and tap one permission prompt. No self-signed certs, no chrome://flags, no accounts.

Latency discipline. One Euro filter phone-side, then a 2ms newest-wins cursor loop on the PC, and deliberately no prediction or lookahead — the cursor is exactly where the phone last said the aim was. It ships live p50/p95 jitter stats so the claim is checkable rather than just asserted.

Roughly 15-30ms phone-side. The interesting result for me was that 6DoF VIO is dramatically better for this than the gyro-based approaches people have tried before: because the camera continuously corrects the IMU, there's no yaw drift and no recentering. You aim at a spot and hit that spot, session after session.

TypeScript throughout, Node 23.6+ with native type stripping so there's no build step in the dev loop.

Code (MIT): https://github.com/ggcaponetto/point-bang

Architecture/protocol docs: https://ggcaponetto.github.io/point-bang/reference/architecture

Demo: https://youtu.be/UE3XUln_xOE

Happy to go into the calibration maths if anyone wants it. I'd also be curious whether anyone has pushed anchors harder than this for long-session stability — that's the part I'd most like to improve.

u/ggcaponetto — 4 days ago
▲ 14 r/emulation+1 crossposts

Me and Claude made a free thing that turns an Android phone into a drift-free PC lightgun to play Time Crisis — no sensor bar, no extra hardware

I wanted to play Time Crisis properly and every option was either dead (CRT + GunCon), expensive (Sinden), or drifty (gyro mice). So I tried something different: the phone already has ARCore, which does camera + IMU tracking. That gives you absolute position in the room, not just rotation — which is exactly what a lightgun needs.

You can find a demo gameplay here: https://youtu.be/UE3XUln_xOE

How it works: you run a small executable on the PC, it prints a QR code. Scan it with the phone, tap through a permission prompt, then point at the three corners of your monitor to calibrate. From then on the phone's aim ray gets intersected with your screen plane and moves the cursor absolutely. Aim data goes over WebRTC straight across your LAN, or over USB if you want the lowest jitter.

The part I'm happiest about: no yaw drift and no recentering. The camera corrects the IMU continuously, so it behaves like a real lightgun rather than a gyro that slowly wanders off. Phone-side latency is roughly 30ms and there's a 2ms cursor loop on the PC.

Other stuff that's in there: 20 remappable on-screen buttons (FIRE is just one of them, with haptics), multi-monitor support with per-monitor calibration and a pause hotkey so the real mouse works when you need it.

Requirements are an ARCore Android phone with recent Chrome, and a Windows or Linux PC on the same network.

It's free and MIT: https://github.com/ggcaponetto/point-bang

It's working end-to-end but still early. I've only tested DuckStation. Would genuinely like to hear how it does on other setups, especially projectors, ultrawides, and anything with a very glossy panel, since those are the tracking cases I'm least sure about. Happy to answer anything or give support.

u/ggcaponetto — 6 days ago

I almost lost it when somebody rang the doorbell after 40 minutes of rocking my baby, so I built bebebell.com — a whisper-quiet QR doorbell that sends parents a gentle SMS.

There is a free plan and I would love to have your feedback.

u/ggcaponetto — 4 months ago