fogón

← Nature3D assetfogon/flores-silvestres

Flores silvestres

by fogonCC03665 blocks
Flores silvestresDrag to turn it
// «Flores silvestres» · gpt-6-sol (medium)
// A low patch of wildflowers: grass with many tiny white, yellow, purple and blue flowers sprinkled over it, flat and wide.

const darkGrass = "#398b38";
const grass = ["#48a944", "#55b84b", "#63c653", "#71cf5c"];
const soil = ["#886039", "#9a7041", "#775334"];

function inside(x, y, margin = 0) {
  const dx = (x - 24) / (19.5 - margin);
  const dy = (y - 24) / (18.5 - margin);
  const ripple = 0.035 * Math.sin(x * 0.9 + y * 0.4)
               + 0.025 * Math.sin(y * 1.3 - x * 0.3);
  return dx * dx + dy * dy < 1 + ripple;
}

// A broad, softly irregular turf mound with a little earth visible at its rim.
for (let x = 4; x <= 44; x++) {
  for (let y = 5; y <= 43; y++) {
    if (!inside(x, y)) continue;

    set(x, y, 0, soil[Math.floor(rand() * soil.length)]);
    set(x, y, 1, rand() < 0.16 ? darkGrass : grass[Math.floor(rand() * 3)]);
    if (inside(x, y, 1.2)) {
      set(x, y, 2, grass[1 + Math.floor(rand() * 3)]);
    }

    // Short, chunky blades break up the otherwise flat top.
    if (inside(x, y, 2) && rand() < 0.18) {
      set(x, y, 3, rand() < 0.5 ? "#58b94b" : "#70cf55");
      if (rand() < 0.28) set(x, y, 4, "#78d65a");
    }
  }
}

// Small wildflowers, spaced so their colorful faces remain legible from above.
const flowers = [
  { petals: ["#fffdf0", "#e9f3eb", "#ffffff"], middle: "#ffc943" },
  { petals: ["#ffda4c", "#ffe879", "#f8ba37"], middle: "#a96329" },
  { petals: ["#a679e5", "#bd96f1", "#9164d4"], middle: "#ffe26b" },
  { petals: ["#68aaf0", "#8bc5ff", "#4d91df"], middle: "#ffdf69" }
];

for (let gx = 8; gx <= 40; gx += 6) {
  for (let gy = 8; gy <= 40; gy += 6) {
    const x = gx + Math.floor(rand() * 3) - 1;
    const y = gy + Math.floor(rand() * 3) - 1;
    if (!inside(x, y, 4) || rand() < 0.12) continue;

    const f = flowers[Math.floor(rand() * flowers.length)];
    const head = rand() < 0.45 ? 5 : 6;
    for (let z = 3; z < head; z++) set(x, y, z, "#398f3e");

    // Four broad petals and a raised golden or warm-colored center.
    set(x - 1, y, head, f.petals[0]);
    set(x + 1, y, head, f.petals[1]);
    set(x, y - 1, head, f.petals[1]);
    set(x, y + 1, head, f.petals[2]);
    set(x, y, head, f.middle);
    set(x, y, head + 1, f.middle);

    if (rand() < 0.45) {
      set(x + 1, y + 1, 3, "#69c750");
      set(x - 1, y, 3, "#4aad45");
    }
  }
}

// A few little leaf pairs and grass sprigs fill the spaces between blooms.
for (let i = 0; i < 105; i++) {
  const x = 6 + Math.floor(rand() * 37);
  const y = 7 + Math.floor(rand() * 35);
  if (!inside(x, y, 2.5)) continue;
  set(x, y, 3, rand() < 0.5 ? "#54b84a" : "#7ad45b");
  if (rand() < 0.35) set(x, y, 4, "#86dc60");
}