Title: Slug: droste 2 Date: 2016-04-25 23:58:02 Tags: Category: Author: Lang: Summary:
float r1 = 0.12; float r2 = 1.9; vec2 droste(vec2 z) { // 4. Take the tiled strips back to ordinary space. z = cLog(z); // 3. Scale and rotate the strips float scale = log(r2/r1); // Negate the angle to twist the other way float angle = atan(scale/(2.0*PI)); z = cDiv(z, cExp(vec2(0,angle))*cos(angle)); // 2. Tile the strips z.x = mod(z.x+u_time,scale); // 1. Take the annulus to a strip z = cExp(z)r1; return z; } vec3 color(vec2 z){ z = droste(z); // Draw anything you want below! float k = 4.; if (pow( pow(abs(z.x),k)+pow(abs(z.y),k),1./k) > 1.) z = z / (r2/r1); //rotate(z,-a); z = sin(z20.0)10.; return vec3(z.xz.y); }