fogón

← AsiáticoObjeto 3Dfogon/jardin-zen

Jardín zen

de fogonCC09199 bloques
Jardín zenArrastrá para girarlo
// «Jardín zen» · gpt-6-sol (medium)
// A square Japanese zen rock garden: a flat bed of light grey sand raked in parallel lines and circles, three dark mossy rocks of different sizes placed asymmetrically, a low wooden border around it and a small bonsai-like shrub in one corner.

const woodDark = "#4a2420";
const woodRed = "#98352c";
const woodLight = "#b74735";
const gold = "#d5a65c";

// Square, low lacquered-wood frame.
box(3, 3, 0, 44, 44, 2, woodDark);
box(3, 3, 2, 44, 4, 4, woodRed);
box(3, 43, 2, 44, 44, 4, woodRed);
box(3, 5, 2, 4, 42, 4, woodRed);
box(43, 5, 2, 44, 42, 4, woodRed);

box(3, 3, 5, 44, 4, 5, woodLight);
box(3, 43, 5, 44, 44, 5, woodLight);
box(3, 5, 5, 4, 42, 5, woodLight);
box(43, 5, 5, 44, 42, 5, woodLight);

// Fine gilt lines along the inner edge.
box(4, 4, 5, 43, 4, 5, gold);
box(4, 43, 5, 43, 43, 5, gold);
box(4, 5, 5, 4, 42, 5, gold);
box(43, 5, 5, 43, 42, 5, gold);

for (const x of [3, 43]) {
  for (const y of [3, 43]) {
    box(x, y, 0, x + 1, y + 1, 6, woodRed);
    box(x, y, 7, x + 1, y + 1, 7, gold);
  }
}
for (const x of [10, 18, 26, 34, 40]) {
  set(x, 3, 3, gold);
}

// Solid bed of pale sand.
box(5, 5, 0, 42, 42, 2, "#b9b5a9");
box(5, 5, 3, 42, 42, 3, "#dcd9ce");

const stones = [
  { x: 13, y: 15, rings: [6, 8] },
  { x: 32, y: 18, rings: [5, 7] },
  { x: 21, y: 32, rings: [4, 6] }
];

// Parallel raking gives way to concentric ripples around each stone.
for (let x = 5; x <= 42; x++) {
  for (let y = 5; y <= 42; y++) {
    let nearest = null;
    let distance = Infinity;
    for (const stone of stones) {
      const d = Math.hypot(x - stone.x, y - stone.y);
      if (d < distance) {
        distance = d;
        nearest = stone;
      }
    }

    if (Math.hypot(x - 38, y - 37) < 4.5) continue;

    if (distance < 9) {
      if (nearest.rings.some(r => Math.abs(distance - r) < 0.45)) {
        set(x, y, 4, "#bcb8aa");
      } else if (nearest.rings.some(r => Math.abs(distance - r - 1) < 0.42)) {
        set(x, y, 4, "#eeeae0");
      }
    } else if (y % 3 === 0) {
      set(x, y, 4, "#c2bfb2");
    } else if (y % 3 === 1) {
      set(x, y, 4, "#ebe7dc");
    } else if (rand() < 0.08) {
      set(x, y, 3, "#d2cec2");
    }
  }
}

// Three asymmetrically placed, differently sized weathered rocks.
ellipsoid(13, 15, 7, 4.5, 3.5, 3.4, "#60665e");
ellipsoid(11.5, 15.5, 9.5, 2.4, 2.4, 3.3, "#747a70");
ellipsoid(15, 14, 6, 2.5, 2.5, 2.2, "#50584f");

ellipsoid(32, 18, 6.5, 3.4, 3, 2.8, "#626a61");
ellipsoid(33, 19, 8, 2, 2.1, 2.8, "#788078");
ellipsoid(30.5, 17, 5.5, 2, 2, 1.8, "#505a52");

ellipsoid(21, 32, 5.5, 2.7, 2.4, 1.9, "#626960");
ellipsoid(20.5, 32.5, 6.5, 1.7, 1.5, 1.9, "#777d72");

// Speckled exposed stone and scattered patches of moss.
const rockColors = new Set([
  "#60665e", "#747a70", "#50584f",
  "#626a61", "#788078", "#505a52",
  "#626960", "#777d72"
]);
forEach((x, y, z, color) => {
  if (!rockColors.has(color)) return;
  const exposed = !get(x, y, z + 1) || !get(x, y - 1, z);
  if (!exposed) return;
  const n = rand();
  if (z >= 7 && n < 0.19) set(x, y, z, n < 0.09 ? "#526c48" : "#708651");
  else if (n > 0.88) set(x, y, z, "#92998a");
  else if (n < 0.045) set(x, y, z, "#414a44");
});

// A little bonsai-like shrub growing directly from the back corner.
ellipsoid(38, 37, 4, 2.5, 2, 0.9, "#87916c");
line(38, 37, 4, 37, 37, 9, 1, "#583c2c");
line(37, 37, 8, 39, 36, 11, 1, "#694631");
line(37, 37, 9, 35, 38, 11, 1, "#694631");
line(38, 36, 9, 40, 38, 10, 0, "#694631");

ellipsoid(35, 38, 11, 2.7, 2, 1.8, "#315b3c");
ellipsoid(39, 36, 12, 3.1, 2.3, 1.9, "#3d7048");
ellipsoid(40, 39, 10.5, 2.4, 2, 1.5, "#315b3c");
ellipsoid(36, 37, 12.5, 1.8, 1.6, 0.8, "#588a56");
ellipsoid(39, 36, 13.4, 2.2, 1.5, 0.7, "#66985f");

const leaves = new Set(["#315b3c", "#3d7048", "#588a56", "#66985f"]);
forEach((x, y, z, color) => {
  if (leaves.has(color) && !get(x, y, z + 1) && rand() < 0.24) {
    set(x, y, z, rand() < 0.65 ? "#80a968" : "#acc078");
  }
});