home
|
featured sketchers
|
gallery
write a sketch
|
community
|
Copy sketch
Printouts
/* * SuperPosition * by PixelPusher * * Inspired by http://www.bugman123.com/Physics/Physics.html * * two radiating points in contrasting colors * Have a blast with it... */ int frames; int maxFrames; int numElipses; void setup() { size(256, 256); ellipseMode(CENTER); noFill(); strokeWeight(4); frames = 0; maxFrames = 3; numElipses = 40; frameRate(4); } void draw() { background(100); smooth(); frames = (frames+1) % maxFrames; pushMatrix(); translate(0, height/4); stroke(200, 0, 180); drawEllipses(numElipses); translate(0, height/2); stroke(0, 200, 180); drawEllipses(numElipses); popMatrix(); } void drawEllipses(int num) { for (int i=0; i<num; i++) { if ( (i % maxFrames) == frames) { float w = 2*256.0*i/num; ellipse(0, 0, w, w); } } } boolean odd(int n) { return ((n % 2) == 0); } boolean even(int n) { return !odd(n); }
Sketches you submit on sketchPatch will be licensed under the
Creative Commons Attribution 3.0 Unported License
. If you upload code based on other people's work, please check the licence compatibility.
Ooops, found some glitches.
Write your sketch here
Check the Processing language
reference
(
most
of it works).
Need inspiration? Play with the examples in
the gallery
.
Title
Tags
Publish
(come on, let other people see your sketch!)
Your comments about the sketch