Random Circles with No Overlap in Processing

Simon translated Daniel Shiffman’s p5.js tutorial on random circles with no overlap into Processing (Java). The project is about a “circle packing”-like algorithm. Circles are placed randomly in the canvas, but only if they are not overlapping with any previous circles.

While translating Simon usually doesn’t look at the original code – “I memorised the code!” he screams. “If I make 1000 circles I get nothing because I’m stuck inside an infinite loop. I’m going to use the variable called Protection! A quick and dirty solution to this!”

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s