Loading video...

Video Failed to Load

Go Home

I'm sharing a tutorial on creating interactive 3D experiences, combining Three.js and MediaPipe hand tracking ๐Ÿ‘‹๐Ÿ’  In this ๐Ÿงต: - a step-by-step guide including the 4 prompts I used to build this demo - the open source code - Other thoughts about vibe coding

151,255 views โ€ข 1 year ago โ€ขvia X (Twitter)

10 Comments

AA's profile picture
AA1 year ago

Prompt 1: "create a demo using mediapipe hand tracking and vanilla js. Show a full width/height webcam feed on the page (mirrored). draw hand landmarks on top of the user's hands. Keep it simple and ensure that it runs locally. We will add more features later on" This gives us a basic webcam feed with hand landmarks drawn on top. (btw, I'm using Claude web for this, but this should a;so work with ChatGPT, Gemini, Grok, etc.)

AA's profile picture
AA1 year ago

Prompt 2: "ok now let's integrate threejs into this demo. Draw a sphere in the scene. It should have a vibrant neon color fill and white wireframe outline. The scene should overlaid on top of the webcam feed and should have no background and no visual elements other than the floating shape. The shape should auto-rotate slowly and stay in the center of the screen. Keep it simple we will add hand tracking interaction after" This now gives us a threejs shape in the scene, but it's not yet linked with the hand movements

AA's profile picture
AA1 year ago

Prompt 3: "now let's add hand tracking interaction to this demo. Right hand: distance between thumb/index finger controls the size of the sphere. Left hand: if the index finger touches with the shape, the color fill of the shape should change to a random neon color" Now we're cooking! the threejs shape is now linked with the mediapipe hand tracking. The positions of the fingers are now being used to drive the size and color of the shape in real-time.

AA's profile picture
AA1 year ago

Prompt 4: "add some smoothing to the resizing of the sphere, to prevent jittering/glitching of the rapid unintended size changes" Just some clean-up to make the size changes smoother. Voila! Our demo is complete. This was a basic example, but the same principles can be used to create games, interactive websites, and other fun augmented reality applications.

AA's profile picture
AA1 year ago

Here's the github repo with the open source code: And here's the live demo:

AA's profile picture
AA1 year ago

Hey guys, here's the tutorial I promised I'd make for you! Sorry it took so long, I got distracted on some side quests ๐Ÿ˜… Hope this is useful! Any likes / reposts would be appreciated ๐Ÿ™‡โ€โ™‚๏ธ @benallfree @AlexerSalcido @craigrrob @AIlife2024ka @thechrislacorte @roileean @artofnazar @3DBeeing @ThaboMode @sarabahri @TrentJConley

Abel's profile picture
Abel1 year ago

@threejs built something similar, what do you think?

AA's profile picture
AA1 year ago

@threejs Really smooth tracking, nice work! I like the integration with voice mode search. What tech stack did you use for this?

John Nack's profile picture
John Nack1 year ago

@threejs Cool! I was the PM for MediaPipe for a while, so I'm very happy to see this work. Just FYI friend Uri has been using it to create a theremin & more:

AA's profile picture
AA1 year ago

@threejs Thank you for everything you did with MediaPipe. It's a lovely piece of tech. So powerful and easy to get started with it. I've been obsessed with it lately and will continue to learn / explore :) The theremin projects looks amazing, thanks for sharing

Related Videos