Want to build a digital character that mirrors your every move? This recipe shows you how to use MediaPipe to track your full body (skeleton) in real time. We’ll use this data to drive interactive 2D and 3D avatars.
Before You Start
You will need to download the MediaPipe TouchDesigner Plugin by Torin Blankensmith. Download it here (get the
release.zip).
1. Setup the Plugin
- Extract the Zip: Place the
toxes/folder right next to your.toeproject file. - Add to TD:
- Press Tab and add a Base COMP. Name it
mediapipe_pose. - Inside, drag in
MediaPipe.toxandPose Tracking.tox.
- Press Tab and add a Base COMP. Name it
- Turn it on:
- Click the
MediaPipenode. - In the parameters, find Pose Tracking and toggle it On.
- Set your Webcam in the dropdown.
- Click the
2. Understanding the Data
The Pose Tracking node gives you 33 points (landmarks) representing your joints:
- Upper Body: Shoulders, Elbows, Wrists, Nose, Ears.
- Lower Body: Hips, Knees, Ankles, Heels, Toes.
Each point has an X, Y, and Z coordinate (0 to 1). Note: Y is often 0 at the top and 1 at the bottom.
3. Extracting Your Hands
Let’s grab your wrist positions to drive some visuals.
- Add a Select CHOP and connect it to the output of the
Pose Trackingnode. - In the Channel Names parameter, type:
P1_wrist_left_* P1_wrist_right_*.- _The
_grabs X, Y, and Z all at once.*
- _The
- Add a Math CHOP. In the “Range” tab, set From Range
0 to 1and To Range-1 to 1. This centers the data for 3D space. - Add a Null CHOP and name it
HAND_DATA.
4. Your First Project: The “Skeleton Puppet”
Let’s make two spheres that follow your hands in 3D space.
- The Shape: Add a Sphere SOP.
- The Container: Connect it to a Geometry COMP.
- Instancing:
- Go to the Instance tab. Turn Instancing →
On. - Drag
HAND_DATAinto the Instance CHOP field.
- Go to the Instance tab. Turn Instancing →
- The Mapping:
- Map Translate X to
P1_wrist_left_x. - Map Translate Y to
P1_wrist_left_y. - Map Translate Z to
P1_wrist_left_z. - Repeat for the right hand by adding another Geometry COMP or using a Merge CHOP.
- Map Translate X to
Troubleshooting
- “The skeleton is upside down.” — Use a Math CHOP on the Y channel with Multiply set to
-1. - “It’s lagging.” — Pose tracking is very heavy. Make sure Pose Tracking is the only model turned on in the MediaPipe COMP.
- “The dots are shaky.” — Add a Lag CHOP between your Select CHOP and your Null to smooth out the movement.
Next Steps
- Draw the Bones: Use the Add SOP to connect the dots (wrist to elbow, elbow to shoulder) to draw a stick figure.
- Jump Trigger: Detect when your
hipY-position goes above a certain height to trigger a sound. - Dance Visuals: Use your movement speed (velocity) to drive the color of a background noise field.
Parameter Tuning & Behavior
| Parameter | Behavior |
|---|---|
| Math Range (-1 to 1) | Determines how much of the 3D screen your movements fill. |
| Lag / Smoothing | Higher = puppet follows with “weight” and grace; Lower = puppet is “twitchy” and mirrors raw data. |
| Hip Y-Threshold | Adjusts the “sensitivity” for detecting a jump or a crouch. |
| Sphere Scale | Higher = large, bulbous joints; Lower = tiny, delicate points of light. |
Network Architecture
To visualize how the pose tracking data flows, here is the final network map:
[ VIDEO INPUT ] [ MEDIAPIPE PLUGIN ]
Webcam TOP ──────────────────▶ [ MediaPipe.tox ]
│
▼
[ SKELETON DECODING ] [ Pose Tracking.tox ]
│
▼
[ JOINTS ] [ Select CHOP ] (P1_wrist_*)
│
▼
[ COORDINATE REMAP ] [ Math CHOP ] (0-1 to -1-1)
│
▼
[ SMOOTHING ] [ Lag / Filter CHOP ]
│
▼
[ EXPORT ] [ Null CHOP (HAND_DATA) ]
│
▼
[ 3D PUPPET ] [ Geo COMP ] ◀──────────────┐
(Instancing On) │
│ │
[ RENDERING ] [ Sphere SOP ] ────────▶ [ Render TOP ]Data Flow Explanation
- Plugin Layer:
MediaPipe.toxis the engine. It runs the “BlazePose” model in an embedded browser and sends the 33 3D landmark points into TouchDesigner. - Joint Decoding: The
Pose Tracking.toxcomponent decodes those 33 points into named channels for every joint (shoulders, elbows, wrists, etc.). - Data Extraction: We use a
Select CHOPto grab just thewristchannels. This gives us the X, Y, and Z positions of both your hands. - The Bridge (Instancing): The
Geo COMPtakes theHAND_DATACHOP and uses it to “spawn” twoSphere SOPson the GPU — one for each hand. - Coordinate Remap: Because MediaPipe uses a 0-1 (top-left) origin, we use a
Math CHOPto remap this to TouchDesigner’s centered 3D space (-1.0 to 1.0), ensuring the spheres move logically on screen.
(y) Return to Recipes & Projects | (y) Return to TouchDesigner | (y) Return to Home