xxxxxxxxxx
18
function setup() {
createCanvas(400, 400); //Make a 400px x 400px canvas to draw on
frameRate(25); //Show 25 frames per second
noStroke(); //Don’t make anything with a stroke or border
fill(0); //Fill shapes with black (0)
createLoop({duration: 4, framesPerSecond: 25, gif: {render: false, download: true, fileName: "revolve.gif"}});
//Library: 4 sec long, 100 frames (25*4), show? download gif? name your gif!
}
function draw() {
background(255);
translate(width / 2, height / 2);
r = height / 4;
x = cos(animLoop.theta) * r;
y = sin(animLoop.theta) * r;
ellipse(x, y, 50, 50);
}