n = frames - n alpha = 2 * n / frames seed(1) for i in xrange(350): fill(1) oval(margin + random() * (width() - 2 * margin) + n * dist - point / 2, margin + random() * (height() - 2 * margin) - point / 2, point, point) fill(1, 0.9) oval( margin + random() * (width() - 2 * margin) + n * dist * 0.6 - point / 2, margin + random() * (height() - 2 * margin) - point / 2, point, point) fill(1, 0.6) oval(margin + random() * (width() - 2 * margin) - point / 2, margin + random() * (height() - 2 * margin) - point / 2, point, point) fill(1, 0.6) oval( margin + random() * (width() - 2 * margin) - n * dist * 0.6 - point / 2, margin + random() * (height() - 2 * margin) - point / 2, point, point) fill(1, 0.3 * alpha) # fill(1, 0.3) oval(margin + random() * (width() - 2 * margin) - n * dist - point / 2, margin + random() * (height() - 2 * margin) - point / 2, point, point) saveSketch("draw")
db.fill(0) db.rect(0, 0, CANVAS[0], CANVAS[1]) db.translate(*loc) db.scale(scale) db.fill(0) db.stroke(1) db.strokeWidth(2) db.lineJoin('round') for row in range(rows): db.save() translate( math.sin(row + frame) * alpha, row * box_size[1] + (box_depth[0] / box_size[0]) * math.sin(row + frame) * alpha) db.drawPath(box) for column in range(columns): db.save() translate( -column * box_size[0] + math.sin(column + frame) * alpha, (box_depth[0] / box_size[0]) * math.sin(column + frame) * alpha) db.drawPath(box) db.restore() db.restore() sh.saveSketch('draw') db.endDrawing()