Last active
March 26, 2020 15:24
-
-
Save volfegan/740d40332ff02e1d6ddb7753e24f7648 to your computer and use it in GitHub Desktop.
Some tripping Hyper Matrix shenanigans
This file contains hidden or 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
//based on: https://twitter.com/ntsutae/status/1242745365608071169 | |
float a, b, i, C, W=720, H=W/2; | |
void setup() { | |
size(720, 720); | |
strokeWeight(C=20); | |
stroke(W); | |
colorMode(HSB, 360); | |
blendMode(DIFFERENCE); | |
} | |
void draw() { | |
fill(C%2*W, 360, 360, 10); | |
square(-9, -9, 900); | |
fill(0); | |
translate(H, H); | |
rotate(C++*PI/2);//divide by other numbers for more effects: PI/3 or PI/4.. PI/7 | |
//stroke(120, 360,360);//for a green layout | |
//stroke(random(1)*(C%360), 360,360); //for a crazy rainbow | |
stroke(noise(1)*(C%360), 360,360); | |
a=map(cos(C*.07), -1, 1, 0, 3); | |
b=map(sin(C*.05), -1, 1, 0, 5); | |
rect(0, 0, H/a, H/b); | |
copy(0, 0, int(W), int(W), 0, 0, int(H), int(H)); | |
//Saves each frame as frame000001.png, frame000002.png, etc. | |
//saveFrame("frame######.png"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment