Created
October 19, 2015 23:08
-
-
Save takawo/32300147b81631d5fa07 to your computer and use it in GitHub Desktop.
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
int numVerticles = 6; | |
int weight = 3; | |
color bgColor, fillColor; | |
float t = 0.0; | |
float s = 2.5; | |
void setup() { | |
size(960, 540, P2D); | |
smooth(); | |
colorMode(HSB, 360, 100, 100); | |
blendMode(ADD); | |
rectMode(CENTER); | |
bgColor = color(210, 80, 5); | |
fillColor = color(0, 80, 40); | |
background(bgColor); | |
} | |
void draw() { | |
translate(width/2, height/2); | |
fill(0, 0, 0, 5); | |
noStroke(); | |
rect(0, 0, width, height); | |
float x = cos(radians(frameCount)) * 150 * noise(t) * 2.5; | |
float y = sin(radians(frameCount)) * 150 * noise(t) * 2.5; | |
float x2 = cos(radians(frameCount)) * 150 * noise(s) * 3.0; | |
float y2 = sin(radians(frameCount)) * 150 * noise(s) * 3.0; | |
stroke(frameCount % 360, 80, 50, 50); | |
strokeWeight(weight); | |
for (float i = 0; i < 360; i += 360.0/numVerticles) { | |
float angle = radians(i); | |
pushMatrix(); | |
rotate(angle); | |
line(x, y, x2, y2); | |
line(-x, y, -x2, y2); | |
popMatrix(); | |
} | |
t += 0.01; | |
s += 0.02; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment