Created
April 23, 2017 13:35
-
-
Save catarak/2697ebae63ebcf37de36514fe69b1555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var video; | |
var x = 0; | |
function setup() { | |
createCanvas(800, 240); | |
pixelDensity(1); | |
video = createCapture(VIDEO); | |
video.size(320, 240); | |
background(0); | |
} | |
function draw() { | |
video.loadPixels(); | |
// image(video, 0, 0); | |
var w = video.width; | |
var h = video.height; | |
copy(video, w/2, 0, 1, h, x, 0, 1, h); | |
x = x + 1; | |
if (x > width) { | |
x = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment