Hand gestures手勢
What a camera can tell about two hands: gestures, a pinch as an event, how open a hand is, its angle, the distance between the hands, drawn on the hands.鏡頭能從兩隻手讀出什麼:手勢、捏一下、手張開多少、手的角度、兩手的距離,數字直接畫在手上。
Try these three things試試這三件事
- Before the camera: two simulated hands open, pinch, make a fist, a victory sign and a thumb up. Watch the numbers on each hand and the signals in the console.
- Turn on 🖐 hands and allow the camera. Open and close your right hand: the flower at your fingertip follows. Pinch thumb and index with the other fingers out: sparks.
- Make a victory sign with the right hand to turn the colours, a thumb up for confetti, a left fist to let the sparks fall. Move both hands apart and together: the ring.
- 鏡頭打開之前:兩隻模擬的手會張開、捏、握拳、比 YA、比讚。看每隻手上的數字,和控台裡的訊號。
- 打開 🖐 hands 並允許鏡頭。右手張開、握起:指尖的花跟著開合。拇指捏食指、其他三指張開:噴出火花。
- 右手比 YA 換顏色,比讚撒彩紙,左手握拳讓火花落下。兩手拉開、靠近:中間的圓圈跟著變大變小。
Needs: Camera (hands).需要:鏡頭(手)。
No hardware? Use Simulated performer · On-screen piano.沒有硬體?用模擬演奏者、螢幕鋼琴。
Read these lines讀這幾行
main.js:113–127 Continuous measures and pulses alike reach the world through routes: a pinch or a gesture is a pulse param.連續的量和脈衝一樣經過路由送進世界:捏一下、一個手勢,就是一個脈衝參數。main.js:73 overlay() draws the camera picture, the skeleton and every number on the hands: the one place the world reads the input directly.overlay() 畫出鏡頭畫面、骨架和手上的每個數字:這是世界唯一直接讀輸入的地方。main.js:167–168 feed() takes hands from anywhere (here, made-up ones) through the same features and signals as the camera's.feed() 讓任何來源的手(這裡是編出來的)走跟鏡頭一樣的計算和訊號。
Next step下一步
In the docs: Body and hands文件裡:身體與手
Next on this route: 12 Leap hands →這條路線的下一個:12 Leap 雙手 →
All examples所有範例