Skip to content

Instantly share code, notes, and snippets.

@gncgnc
Created August 9, 2018 07:35
Show Gist options
  • Save gncgnc/72ec60c17842aef956904814f90dea03 to your computer and use it in GitHub Desktop.
Save gncgnc/72ec60c17842aef956904814f90dea03 to your computer and use it in GitHub Desktop.
var canvElt,
numFrames = 120,
duration = 3000,
recording = true,
time = 0
function setup() {
canvElt = createCanvas(600, 600).elt;
noStroke();
}
function draw() {
background(255);
time = ((frameCount+frameCount/2)%numFrames)/numFrames
blendMode(DIFFERENCE)
var numCircs = 10;
for(var j=0; j<4; j++) {
translate(width/2,height/2)
rotate(PI/2)
translate(-width/2,-height/2)
fill(rgb[k])
for (var i = 0; i < numCircs+4; i++) {
var r = ((numCircs-i+time*4))/numCircs * width * 1.4142;
fill(i%2 * 255)
r > 0 ? ellipse(0,0,2*r,2*r) : null;
}
}
blendMode(BLEND)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment