/* Pexelsのcottonbroによる動画を利用しています:https://www.pexels.com/ja-jp/video/3205917/ */ let video; function setup() { createCanvas(640, 360); video = createVideo('video.mp4'); video.loop(); video.hide(); // html要素を隠す為 } function draw() { background(0); video.loadPixels(); for (let y = 0; y < height; y += 20) { for (let x = 0; x < width; x += 20) { const i = y * width + x; const c = video.get(x,y); let radius = 20; fill(c); ellipse(x,y,radius, radius); } } }