Last active
May 2, 2021 22:10
-
-
Save volfegan/d7a905b9839d7db477dfb548fd43a865 to your computer and use it in GitHub Desktop.
A mandala made from OR triangles overflow from the centre in a XOR munching square landscape
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
//inspired from Flopine 8bit demoscene code | |
//https://www.youtube.com/watch?v=_JQm46HuDEE | |
int f=1,t,u,v,x,y; | |
void setup() { | |
size(1280, 720); | |
colorMode(HSB); | |
noStroke(); | |
clear(); | |
} | |
void draw() { | |
t+=f; | |
if (t>4e3 || t<0) f*=-1; | |
for (y=0; y< height;y+=5) { | |
for (x=0; x< width;x+=5) { | |
u = abs(x-width/2); | |
v = abs(y-height/2); | |
fill(((int((u^v)+t)>>2)+.5*t%(u|v))%150+69,255,255); | |
//fill(((int((u^v)+t)>>2)+.5*t%(u|v))%150+69); //black&white | |
//fill(((int((u^v)+t)>>2)+.5*t%((u|v)+(u&v)))%150+69,255,255);//reticular diamond overgrow | |
rect(x,y,5,5); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment