Skip to content

Instantly share code, notes, and snippets.

@companje
Created March 30, 2022 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/18342a399492fbec4292effff90ebc35 to your computer and use it in GitHub Desktop.
Save companje/18342a399492fbec4292effff90ebc35 to your computer and use it in GitHub Desktop.
Tixy.pde - a processing.org tribute to Martin Kleppe's https://tixy.land
//a tribute to Martin Kleppe's https://tixy.land
//with Processing.org by Rick Companje, March 31, 2022
int effect = 0;
int w[] = {-1,0,1};
void setup() {
size(512, 512);
frameRate(30);
}
void draw() {
background(0);
float tixy=0, t=frameCount*.025;
for (int y=0, i=0; y<16; y++) {
for (int x=0; x<16; x++, i++) {
switch (effect) {
case 0: tixy = sin(y/8.+t); break;
case 1: tixy = random(1)<.1 ? 1 : 0; break;
case 2: tixy = random(1); break;
case 3: tixy = sin(t); break;
case 4: tixy = i/256.; break;
case 5: tixy = x/16.; break;
case 6: tixy = y/16.; break;
case 7: tixy = y-7.5; break;
case 8: tixy = y-t*4; break;
case 9: tixy = w[i%3]; break;
case 10: tixy = sin(t-sqrt(pow(x-7.5,2)+pow(y-6,2))); break;
case 11: tixy = sin(y/8.+t); break;
case 12: tixy = y-x; break;
case 13: tixy = ((y>x)&&(14-x<y)) ? 1 : 0; break;
case 14: tixy = i%4 - y%4; break;
case 15: tixy = (x%4!=0 && y%4!=0) ? 1 : 0; break;
case 16: tixy = (x>3 & y>3 & x<12 & y<12) ? 1 : 0; break;
case 17: tixy = (x>t & y>t & x<15-t & y<15-t) ? 1 : 0; break;
case 18: tixy = (y-6) * (x-6); break;
case 19: tixy = (int(y-4*t)|0) * (int(x-2-t)|0); break;
case 20: tixy = int(4*t)&i&x&y; break;
case 21: tixy = ((int(t*10) & int(1<<x))>0 && y==8) ? 1 : 0; break;
case 22: tixy = random(2)-1; break;
case 23: tixy = cos(t+i+x*y); break;
case 24: tixy = sin(x/2.) - sin(x-t) - y+6; break;
case 25: tixy = (x-8)*(y-8) - sin(t)*64; break;
case 26: tixy = -.4/(sqrt(pow(x-t%10,2)+pow(y-t%8,2))-t%2*9); break;
case 27: tixy = sin(t-sqrt(x*x+y*y)); break;
case 28: tixy = y-t*3+9+3*cos(x*3-t)-5*sin(x*7); break;
case 29: tixy = 1/32.*tan(t/64*x*tan(i-x)); break;
case 30: tixy = (x==0 | x==15 | y==0 | y==15) ? 1 : 0; break;
case 31: tixy = sin(2*atan((y-7.5)/(x-7.5))+5*t); break;
case 32: tixy = (x-y)/24. - sin(t); break;
case 33: tixy = sin(t*5) * tan(t*7); break;
case 34: tixy = pow(x-5,2) + pow(y-5,2) - 99*sin(t); break;
}
strokeWeight(abs(constrain(tixy, -1, 1))*32);
stroke(tixy>0 ? 255 : color(255, 80, 80));
point(x*32+16, y*32+16);
}
}
}
void mousePressed() {
effect = (effect+1) % 34;
}
@companje
Copy link
Author

companje commented Mar 30, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment