Created
March 13, 2018 22:32
-
-
Save jeffnoko/317359bc929c771f27bf77ef5644d080 to your computer and use it in GitHub Desktop.
Circles and ovals made up of random placed dots random size and location
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
import processing.serial.*; | |
Serial myPort; | |
float radius1 = random(100, 300); | |
float radius2 = random(100, 300); | |
int count =0; | |
float pos1 = random(200, width -200); | |
float pos2 = random(200, height -200); | |
float A = random(500, 1500); | |
int counter = 0; | |
void setup() { | |
size(1000, 1000); | |
frameRate(60); | |
strokeWeight(random(1, 10)); | |
smooth(); | |
background(255); | |
} | |
void draw() { | |
if (count+1 > A) { | |
A = random(500, 2500); | |
count = 0; | |
radius1 = random(50, 300); | |
radius2 = random(50, 300); | |
pos1 = random(0, width); | |
pos2 = random(0, height); | |
if (counter % 2 == 0) { | |
stroke(255); | |
} | |
else { | |
stroke(0); | |
} | |
strokeWeight(random(1, 10)); | |
counter++; | |
} | |
if (count< A) { | |
float q = random(1) * (2*PI); | |
float r = sqrt(random(1)); | |
float x = pos1+(radius1 * r) * cos(q); | |
float y = pos2+(radius2 * r) * sin(q); | |
point(x, y); | |
} | |
count++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment