xxxxxxxxxx
var img;
var x = 0;
var y = 0;
function setup() {
c = createCanvas(640, 480);
background(0);
img = createCapture(VIDEO);
img.size(640, 480);
img.hide();
}
function draw() {
img.loadPixels();
var line = img.get(x, 0, 1, img.height);
translate(x, 0);
rotate(sin(millis()/1000.0));
image(line, 0, 0);
if (x < img.width)
x += 1; // += 2 -> Spationierung / Speed
else
x = 0;
}
function mousePressed()
{
saveCanvas(c, 'screenshot', 'jpg');
}