跳到正文
cabbit· 来源· @cabbitar · X·· 6 天前精选AI 评分68
推荐理由

原文拆解了利用手机摄像头、MediaPipe手部追踪和Depth Anything实现低成本AR游戏的完整步骤。

正文 · 原文

this is wild...

this guy reverse-engineered his phone camera with Fable 5.2 into an AR camera

you can hook it up to any webcam and your room becomes a game: 3D gifts, mushrooms and drums spawn wherever you point, live

shoot them with a laser from your finger, and when time's up your whole room gets sucked into a hole in the floor

it's free, open source and runs on a regular laptop

here's the full breakdown:

step 1 → turn your phone into a webcam: Continuity Camera on iPhone + Mac, DroidCam on Android

step 2 → install hand tracking with one command: pip install mediapipe

now the laptop sees your hand in the phone feed, 21 points per hand, live

step 3 → grab the index fingertip (landmark 📷 and draw a ray from it into the scene

that ray is your laser pointer

step 4 → estimate depth from the same camera with Depth Anything V2, so the app knows where the floor and walls are

step 5 → render the objects with three.js on top of the camera feed, anchored to the floor so they stay put when you move the phone

step 6 → when the ray hits an object, pop it and add to the score. a 60-second timer makes it a game

step 7 → for the ending, warp the camera image into a spiral around one point on the floor and fade to black. that's the "room falls into the hole" effect

step 8 → put it on your phone: three.js + WebXR runs AR right in Chrome on Android, no app store needed

under the hood:

→ MediaPipe finds your hand in every frame on the CPU, no GPU needed, which is why it keeps up with live video

→ Depth Anything turns one normal camera into a rough 3D scanner, so you don't need a LiDAR phone

→ the vortex at the end is just a shader that twists the camera image, no 3D model of the room

http://github.com/google-ai-edge/mediapipe
try it yourself

then read the guide on how to reverse-engineer any device with Claude:

来源:cabbit · x.com