Created
March 30, 2020 22:01
-
-
Save clemp/a028c81afe6e58c88bbd120924a715a5 to your computer and use it in GitHub Desktop.
Expanding ellipses
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
int count; | |
int maxradius = 40; | |
float growth = 0.6; | |
// perlin noise incrementer | |
float xoff; | |
void setup() { | |
size(400, 400); | |
// initialize parameters | |
count = 0; | |
xoff = 0.0; | |
} | |
void draw() { | |
background(0); | |
// set drawing parameters | |
noFill(); | |
stroke(255); | |
// expand circle until a certain point, then stop | |
if (count < maxradius) { | |
ellipse(width/2, height/4, count*growth, count*growth); | |
} | |
// expand circle until a certain point, then repeat | |
float rad = count % maxradius; | |
ellipse(width/2, height/2, rad*growth, rad*growth); | |
// expand circle radius randomly | |
float randomrad = (count % maxradius) * noise(xoff); | |
//ellipse(width/2, 300, randomrad, randomrad); | |
ellipse(width/2, 300, randomrad, randomrad); | |
xoff += 0.03; | |
count++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment