Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x, y;
- int i = 1;
- int dia = 1;
- int sph = 1;
- float angle = 0.0;
- float speed = 6.15;
- float orbit = 100;
- void setup()
- {
- background(#666666);
- size(1280, 800);
- fill(#666666);
- stroke(#666666);
- strokeWeight( 2 );
- smooth();
- }
- void draw()
- {
- frameRate( 30 );
- if ( i % 2 == 0 )
- {
- fill(#b5f77c);
- } else if( i % 3 == 0 ) {
- fill(#7cb5f7);
- } else if( i % 5 == 0 ) {
- fill(#f77cb5);
- } else if( i % 7 == 0 ) {
- fill(#888888);
- }
- orbit += 0.5;
- //speed += 0.00001;
- angle += speed % (width * height);
- float sinval = sin(angle);
- float cosval = cos(angle);
- x = ( -100 ) + (cosval * orbit);
- y = (height + 100) + (sinval * orbit);
- dia %= 41;
- ellipse(x, y, dia, dia);
- dia++;
- i++;
- }
- void keyPressed()
- {
- if(key == 's')
- {
- save("spiral.png");
- noLoop();
- }
- }
Add Comment
Please, Sign In to add comment