From 5918ee17936c82392bc046932952475eef5f8b77 Mon Sep 17 00:00:00 2001 From: nesso <39450094+fracnesco@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:40:47 +0100 Subject: [PATCH] Added an example Added an example using the webcam and the mouse --- 6-p5.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/6-p5.js b/6-p5.js index 8e11457..03ea690 100644 --- a/6-p5.js +++ b/6-p5.js @@ -76,3 +76,17 @@ src(s0) .scale(1.01) .hue(0.04) .out() + + +//example using mouse and webcam +p1 = new P5() +p1.draw = () => { +p1.clear() +p1.circle(p1.mouseX, p1.mouseY, p1.mouseIsPressed*50)} +// +s3.init({src: p1.canvas}) +s1.initCam(0) +// +src(o1).layer( src(s3).mask(src(s3)) ).out(o1) +// +src(s1).mult(src(o1)).out()