Kann mir jemand erklären was bei dem Programm in Zeile 4-10, 38 und 54 passiert?
Java:
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
return 1 - 0.8 * pow(2*(1 - p), g);
}
int numFrames = 300;
void setup() {
size(800, 800, P3D);
rectMode(CENTER);
result = new int[width*height][3];
fill(2);
blendMode(EXCLUSION);
noStroke();
}
color[] cs = { #00EDEB, #ED00D6, #0700ED};
float x, y, z, tt;
int N = 15;
int L = 20;
float r = 20, sp = 1.9*r;
float shift, dd, rot;
void draw() {
background(0);
push();
translate(width/2, height/2);
t = (millis()/(20.0*numFrames))%1;
for (int a=0; a<3; a++) {
fill(cs[a]);
for (int i=-N; i<N; i++) {
for (int j=-N; j<N; j++) {
x = (i+.1)*L;
y = (j+.1)*L;
if (j%2 != 0)
x += 0.5*sp;
dd = dist(x, y, 0, 0)/160.0;
tt = 2 * t - dd + 0.02*a;
shift = lerp(1, 0.9, ease(map(cos(TWO_PI*tt), 1, -1, 0, 1), 3));
push();
translate(x*shift, y*shift);
ellipse(6, 6, 6, 6);
pop();
}
}
}
pop();
}