Lab 06
Lab 06 · Body balls
Notes
What I did
-
Step 1: a
Ballclass. 1500 purple balls shake and change size every frame. -
Step 2:
respond(active)turns a ball yellow or random colour with super ball, or back to purple. - Step 3: click a ball and it turns yellow.
-
Step 4: ml5.js
bodySegmentationfinds my body in the webcam.isOnBody()checks the mask under each ball, so balls on my body turn yellow.
Bonus
- Click and body together: a ball is active if it was clicked or it is on my body.
- Active balls shake harder: they move and grow 4× more than normal balls.
-
Super Ball: extendsBall. It starts purple. When it is clicked (active), it flashes random colors and shakes harder.
The git repo: Lab06