Created
October 20, 2015 16:26
-
-
Save vampjaz/86aa31e7aaeb01d96e98 to your computer and use it in GitHub Desktop.
Cool program
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
void setup() { | |
size(displayWidth,displayHeight); | |
background(0); | |
colorMode(HSB); | |
} | |
float angle = 0; | |
float col = 0; | |
float increment = 0.7; | |
float linelen = 10; | |
void draw() { | |
for (int c = 0; c < 5; c++) { | |
angle += 0.5; //(mouseX/width); | |
if (angle > 360) angle = 0; | |
col += 0.1; //(mouseY/(float)width)*4; | |
if (col > 255) col = 0; | |
strokeWeight(5); | |
stroke(col,255,255); | |
float tempa = angle; | |
for (int i = 0; i < (width/linelen); i++) { | |
float sx = sin(radians(tempa)) * i*linelen; | |
float sy = cos(radians(tempa)) * i*linelen; | |
float ex = sin(radians(tempa-increment)) * (i+1)*linelen; | |
float ey = cos(radians(tempa-increment)) * (i+1)*linelen; | |
line(width/2 + sx,height/2 + sy,width/2 + ex,height/2 + ey); | |
tempa -= increment; | |
} | |
fill(0); | |
noStroke(); | |
ellipse(width/2,height/2,20,20); | |
} | |
} | |
void keyPressed() { background(0); } | |
boolean sketchFullScreen() { return true; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment