CamPlay reads nine upper-body landmarks from Google’s MediaPipe pose model, measures every movement in units of your own shoulder width, and only fires a gesture when two body parts agree. A jump needs your nose and hips to rise together. Jogging is read from arm pump and head bob rather than your legs, so you can play about a meter from the screen with no calibration step.
A pose model such as Google’s MediaPipe Pose Landmarker, a variant of BlazePose (Bazarevsky et al., 2020), hands you 33 body landmarks per frame, each with a confidence score. CamPlay runs it about 22 times a second. Turning that stream into game controls that feel instant, never fire by accident, and work for a tall player three meters away and a shorter one a meter away is where the real engineering lives. This article documents how CamPlay’s input engine does it, decision by decision, including the counterintuitive ones.
Why does CamPlay ignore your legs?
The most surprising fact about CamPlay’s detection is that it never looks at your legs. Of the 33 landmarks the model produces, the engine uses exactly nine: nose, both shoulders, both elbows, both wrists and both hips. Nothing below the hips is required.
That is a product decision disguised as a technical one. Requiring ankles in frame means the player has to stand three or four meters from the laptop, which most bedrooms, dorms and offices do not allow. Requiring only head-to-waist means you can play about a meter from the screen. The cost is that “obvious” signals like knee height are off the table, and everything has to be inferred from the torso and arms. The rest of this article is about paying that cost well.
The unit that makes everything work: shoulder width
Landmark coordinates are normalized to the camera frame, so every raw distance changes when the player steps closer or farther away. A jump that moves the nose by 12% of the frame at two meters moves it 20% at one meter. Hard-coded pixel thresholds would make the controls feel different at every distance.
CamPlay’s fix is to measure everything in units of the player’s own smoothed shoulder width (SW). Shoulder width in the image scales with distance from the camera the same way every other body measurement does, so dividing by it cancels distance out. A jump threshold of “0.30 SW” means the same physical movement whether you are near or far, tall or short. This one normalization is what lets the engine ship without a calibration screen. The slap games (Slap Derby, Zombie Slap, Pera nai, Chill!) use the same unit for swings: hand speed is measured in shoulder widths per second, so a slap reads the same at 1.5 meters as at 3.
How do you detect jogging in place without leg landmarks?
From its upper-body signature. When people jog, three things happen in rhythm: the arms pump, the elbows rise with each swing, and the head bobs up and down. The engine multiplies all three into a continuous speed value from 0 to 1:
- Cadence. A “pump” counts when a wrist rises above its own slow-moving average while the elbow on the same side is also up. About three pumps per second maps to full speed.
- Amplitude. Bigger arm swings score higher than wrist wiggles, so half-hearted movement produces half-hearted speed.
- Head bob. The whole product is gated by vertical nose movement. This is the anti-cheat term: waving your arms with a still head scores roughly zero, because real jogging bounces your head and fake jogging doesn’t.
flowchart LR
W["Wrist rises above<br/>its slow average"] --> PUMP["Pump counted"]
E["Same-side<br/>elbow up"] --> PUMP
PUMP --> CAD["Cadence<br/>3 pumps/s ≈ full speed"]
CAD --> MUL(("×"))
AMP["Swing amplitude"] --> MUL
BOB["Head-bob gate<br/>still head ≈ zero"] --> MUL
MUL --> G["gamma 1.6"] --> SPD["speed 0–1"]The combined value is then compressed with a gamma curve (raised to the power 1.6), which maps light jogging to low speeds on purpose. The difference between strolling pace and a real sprint should be felt in the game, or there is no reason to work. One practical wrinkle: wrists can leave the frame when your arms hang fully down, so pump counting pauses and resumes per arm without glitching the speed.
How are jumps and ducks detected?
A naive jump detector (“the nose moved up fast”) misfires constantly: on tiptoes, on stretches, on the natural head bounce of jogging. CamPlay requires two independent body parts to agree. A jump registers only when the nose rises more than 0.30 SW and the hips rise more than 0.25 SW above their reference at the same time. Your head can move without your hips (looking up, stretching), but head and hips rising together means your whole body left the ground.
flowchart LR
N["Nose rises<br/>> 0.30 SW"] --> AND{"both,<br/>together"}
H["Hips rise<br/>> 0.25 SW"] --> AND
AND -- "agree" --> J["Jump event"]
AND -- "only one moves" --> X["Ignored<br/>(stretch, tiptoe, head bounce)"]Ducks are the mirror image: the nose drops more than 0.55 SW and the hips drop with it. Jumps are one-off events, fired once per hop. Ducks are held states with separate enter and exit thresholds, so the game knows exactly how long you stayed low. That matters when you are sliding under a fire beam in Rune Run or holding a slow-motion dodge in Dino Dodge.
One more layer: the jump thresholds rise with your current running speed. Jogging hard makes your head bounce more, so the bar for a deliberate jump goes up with it. Without that link, sprinting would fire phantom jumps every few strides.
How is “rise” defined without calibration?
“Nose rises 0.30 SW” raises the question: above what? Above an adaptive reference, a slow-tracking average of where your nose and hips normally sit. It follows gradual change quickly (you drift closer to the camera, you slouch as you tire) but resists fast vertical motion, so the jump you are doing doesn’t drag its own baseline upward. The moment a gesture begins, the reference freezes until the gesture ends, so a long duck can never become the new normal.
This replaces the calibration step you might expect, such as “stand still with your arms out”. There is no T-pose at startup and no stored per-user profile. The reference settles within a couple of seconds of you entering the frame and settles again after any change in posture.
Leans and lanes: intent versus position
Sideways movement carries two different meanings, so the engine tracks two different signals. A lean is an intent gesture. It registers when your shoulder line tilts past 18 degrees and your head shifts sideways more than 0.22 SW past the middle of your shoulders. Both are required, so glancing sideways doesn’t steer you. It releases at 10 degrees, and that 8-degree gap (hysteresis) prevents flicker when you hover near the threshold. Ski Slalom uses the same tilt angle as a fully analog value: a gentle lean carves a long arc, a hard lean cuts tight.
A lane, by contrast, is a position: which third of the frame your body occupies. The boundaries are not straight vertical lines. They slant like parking-camera guides, making the center lane narrower at the top of the frame and wider at the bottom, which matches how a body projects into the image as it moves sideways. Your lane is whichever region overlaps most of your body at torso height, and switching requires beating the current lane’s overlap by an 8% margin. That is hysteresis again, so standing on a boundary never rattles you between lanes.
Stillness as a control: the Red Light problem
One game turns the problem around. Red Light, Green Light needs to know you are not moving, and “no jump events fired” is far too weak a test when the doll is staring at you. For this, the engine exposes a raw motion signal: the speed of your fastest-moving tracked points, in shoulder widths per second. During a red light the game layers several tests on it: a fast rule for outright running, a slow-burn rule for creeping at low speed for more than a second, the raw motion signal held above a threshold, and any discrete gesture at all. A short grace period after the light changes covers honest human reaction time, and then the judge is strict.
Knowing when not to trust the camera
The engine’s most important signal is the plainest: ready. It is true only while all nine required landmarks are confidently visible. It takes 10 good frames in a row to switch on and 15 bad frames to switch off. While not ready, input is paused, held states release and speed decays to zero. The games show this right away (“step back into frame”) instead of letting a half-visible body produce garbage controls. In multiplayer, staying untrackable for more than 1.2 seconds disqualifies the run, because a player the camera cannot see is a player the game cannot referee. The calorie tracker follows the same rule: if the camera can’t see you, you earn nothing.
The shape of the whole thing
Every technique above is a variation on three principles. Normalize by the body itself (shoulder width), so nothing depends on where the player stands. Require agreement between independent signals (nose and hips, tilt and head shift, cadence and bob), so no single noisy landmark can trigger anything. And put hysteresis on every boundary, so thresholds feel decisive instead of jittery. None of it is exotic machine learning. The model does the perception, and everything on top is careful, testable signal engineering. That split keeps the system debuggable: when a control misbehaves, the fix is a named threshold, not a retraining run.