diff --git a/2020/sketch_2020_03_09b/0343.png b/2020/sketch_2020_03_09b/0343.png new file mode 100644 index 00000000..a753b266 Binary files /dev/null and b/2020/sketch_2020_03_09b/0343.png differ diff --git a/2020/sketch_2020_03_09b/3106.png b/2020/sketch_2020_03_09b/3106.png new file mode 100644 index 00000000..8ef6aa10 Binary files /dev/null and b/2020/sketch_2020_03_09b/3106.png differ diff --git a/2020/sketch_2020_03_09b/3503.png b/2020/sketch_2020_03_09b/3503.png new file mode 100644 index 00000000..69a2e03a Binary files /dev/null and b/2020/sketch_2020_03_09b/3503.png differ diff --git a/2020/sketch_2020_03_09b/sketch_2020_03_09b.png b/2020/sketch_2020_03_09b/sketch_2020_03_09b.png new file mode 100644 index 00000000..cb9c0130 Binary files /dev/null and b/2020/sketch_2020_03_09b/sketch_2020_03_09b.png differ diff --git a/2020/sketch_2020_03_09b/sketch_2020_03_09b.pyde b/2020/sketch_2020_03_09b/sketch_2020_03_09b.pyde new file mode 100644 index 00000000..4f7135bf --- /dev/null +++ b/2020/sketch_2020_03_09b/sketch_2020_03_09b.pyde @@ -0,0 +1,51 @@ + +ens = [] +template = ((-1, -1), (-1, 1), (1, 1), (1, -1)) + +def setup(): + size(500, 500) + noFill() + strokeJoin(ROUND) + for _ in range(5): + ens.append(create_points()) + +def create_points(): + pts = [] + for x, y in template: + w = random(25, 75) + pts.append((x * w, y * w)) + return pts + +def draw(): + background(240) + translate(width / 2 - 50, height / 2) + offsets = ens[0] + for offset, pts in zip(offsets, ens[1:]): + pushMatrix() + translate(*offset) + for dx in range(10): + pts_copy = pts[:] + translate(10, 0) + fc = 5 * dx + frameCount + pts_copy[2] = lerpPoint(pts_copy[2], + pts_copy[3], + (1 + cos(fc/20.))/2) + plot_poly(pts_copy) + popMatrix() +def lerpPoint(a, b, t): + c = [lerp(ea, eb, t) for ea, eb in zip(a, b)] + return c + +def plot_poly(points): + beginShape() + for p in points: + vertex(*p) + endShape(CLOSE) + +def keyPressed(): + if key == ' ': + ens[:] = [] + for _ in range(5): + ens.append(create_points()) + if key == 's': + saveFrame("####.png")