xxxxxxxxxx
49
let panopticon;
let sliceX;
let sliceY;
let thickness;
let long;
let quick;
let angle = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
panopticon = createCapture(VIDEO);
panopticon.size(windowWidth, windowHeight);
panopticon.position(0, 0);
panopticon.hide();
//rectMode(CENTER);
//imageMode(CENTER);
frameRate(30);
thickness = 1;
long = windowWidth / 2 - 35;
sliceX = random(30, width / 2);
sliceY = random(30, height / 2);
quick = 0.003;
print("taking slice from (" + sliceX + ", " + sliceY + ")");
}
function draw() {
let slice = panopticon.get(sliceX, sliceY, long, thickness);
// get(starting pixel x, y, width, length)
angle += quick;
translate(width / 2, height / 2);
rotate(angle);
fill("#A78DD4");
//rect(0, 0, long, thickness);
image(slice, 0, 0);
}
function mousePressed() {
saveCanvas("myCanvas", "jpg");
}