var seed = Math.random() * 1249;
mySize = min(windowWidth, windowHeight);
createCanvas(mySize, mySize);
colorMode(RGB, 255, 255, 255, 100);
parNum = int(random(25, 50)) * int(random(2,10));
for (let j = 0; j < 1; j++) {
for (let i = 0; i < parNum; i++) {
particles1.push(new Particle1(0 , 0))
color_vision = random([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
let filter1 = new makeFilter();
translate(width / 2, height/2);
rotate(random(TAU)+noise(frameCount*0.01));
for (let i = particles1.length - 1; i > 0; i--) {
if (i < particles1.length) {
if (int(seed) % 2 == 0) {
particles1[i].color_vision = color_vision;
if (particles1[i].alpha2 < 30) {
if (particles1[i].finished()) {
strokeWeight(random(0.1, 0.05));
drawingContext.setLineDash([1, 1, 1, 1]);
image(overAllTexture, 0, 0);
rect(0, 0, width, height);
function drawOverPattern() {
translate(width / 2, height / 2);
let s = mySize / 2 * sqrt(3) - 2;
for (let theta = 0; theta < TWO_PI; theta += TWO_PI / 6) {
divideOP(0, 0, s * cos(theta), s * sin(theta), s * cos(theta + TWO_PI / 6), s * sin(theta + TWO_PI / 6), n);
function prop(x1, y1, x2, y2, k) {
let x3 = (1 - k) * x1 + k * x2;
let y3 = (1 - k) * y1 + k * y2;
function divideOP(x1, y1, x2, y2, x3, y3, n) {
let [xA, yA] = prop(x1, y1, x2, y2, 1 / 3);
let [xB, yB] = prop(x1, y1, x2, y2, 2 / 3);
let [xC, yC] = prop(x2, y2, x3, y3, 1 / 3);
let [xD, yD] = prop(x2, y2, x3, y3, 2 / 3);
let [xE, yE] = prop(x3, y3, x1, y1, 1 / 3);
let [xF, yF] = prop(x3, y3, x1, y1, 2 / 3);
let [xG, yG] = prop(xF, yF, xC, yC, 1 / 2);
divideOP(x1, y1, xA, yA, xF, yF, n - 1);
divideOP(xA, yA, xB, yB, xG, yG, n - 1);
divideOP(xB, yB, x2, y2, xC, yC, n - 1);
divideOP(xG, yG, xF, yF, xA, yA, n - 1);
divideOP(xC, yC, xG, yG, xB, yB, n - 1);
divideOP(xF, yF, xG, yG, xE, yE, n - 1);
divideOP(xG, yG, xC, yC, xD, yD, n - 1);
divideOP(xD, yD, xE, yE, xG, yG, n - 1);
divideOP(xE, yE, xD, yD, x3, y3, n - 1);
makeTriangle([x1, y1], [x2, y2], [x3, y3]);
function makeTriangle(v1, v2, v3) {
let points = shuffle([v1, v2, v3]);
let [x1, y1] = points[0];
let [x2, y2] = points[1];
let [x3, y3] = points[2];
let iStep = 1 / (pow(2, floor(random(4, 2))));
for (let i = 0; i < 1; i += iStep) {
let [x4, y4] = prop(x1, y1, x2, y2, 1 - i);
let [x5, y5] = prop(x1, y1, x3, y3, 1 - i);
triangle(x1, y1, x4, y4, x5, y5);
drawingContext.shadowColor = color(0, 0, 5, 45);
overAllTexture = createGraphics(windowWidth, windowHeight);
overAllTexture.loadPixels();
for (var i = 0; i < width; i++) {
for (var j = 0; j < height; j++) {
color(0, 10, 0, noise(i / 3, j / 3, (i * j) / 100) * random(10, 5))
overAllTexture.updatePixels();
if (key === "s" || key === "S") {
saveCanvas("0728_Mood_07_4_blooming_2022", "png");