Created
October 26, 2017 12:34
-
-
Save anonymous/4c46d08275f1849826052391938fa44a 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 NUM = 24; | |
void setup(){ | |
size(640, 640); | |
noStroke(); | |
rectMode(CENTER); | |
} | |
void draw(){ | |
background(0, 0, 30); | |
translate(width / 2, height / 2); | |
for(int i = 0; i < NUM; i++){ | |
float angle = i * TWO_PI / NUM; | |
float v = pow(abs(sin(angle / 2 + frameCount * 0.03)), 4); | |
float r = map(v, 0, 1, 10, 20); | |
fill(lerpColor(color(45, 91, 80), color(191, 255, 0), v)); | |
ellipse((150 + r) * cos(angle), (150 + r) * sin(angle), r * 2, r * 2); | |
} | |
for(int i = 0; i < NUM; i++){ | |
float angle = i * TWO_PI / NUM; | |
float v = pow(abs(sin(angle / 2 + frameCount * 0.03)), 4); | |
float r = map(v, 0, 1, 5, 10); | |
fill(lerpColor(color(45, 91, 80), color(191, 255, 0), v)); | |
ellipse((100 + r) * cos(angle), (100 + r) * sin(angle), r * 2, r * 2); | |
} | |
//noFill(); | |
stroke(random(0,255), random(0,255), random(0,255)); | |
strokeWeight(5); | |
ellipse(CENTER, CENTER, 100, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment