fogón

← NaturalezaObjeto 3Dfogon/nido

Nido con huevos

de fogonCC012372 bloques
Nido con huevosArrastrá para girarlo
// «Nido con huevos» · gpt-6-sol (medium)
// A bird nest of tangled brown twigs, bowl shaped, holding three pale blue speckled eggs.

const cx = 24, cy = 24;
const bark = ["#70452c", "#895735", "#a56b3e", "#bd8450", "#d39b61"];
const twig = ["#69402a", "#815033", "#9b6038", "#b47745", "#ce9258"];

// A solid, gently tapered bowl with an open center.
for (let x = 3; x <= 45; x++) {
  for (let y = 3; y <= 45; y++) {
    const dx = x - cx, dy = y - cy;
    const angle = Math.atan2(dy, dx);
    const r = Math.hypot(dx, dy);
    const uneven = 0.65 * Math.sin(7 * angle) +
                    0.45 * Math.sin(13 * angle + 1.2);
    for (let z = 0; z <= 14; z++) {
      const outer = [13, 15, 16, 17, 18, 18.7, 19.3, 19.7,
                     20, 20, 19.7, 19.2, 18.6, 17.9, 16.9][z] + uneven;
      const inner = z <= 4 ? 0 : 10.8 + (z - 5) * 0.42;
      if (r > outer || r < inner) continue;
      if (z === 14 && rand() < 0.53) continue;

      let shade = z < 4 ? 0 : z < 8 ? 1 : z < 11 ? 2 : 3;
      if (r < inner + 2 && z >= 5) shade = 0;
      if (rand() < 0.17) shade += rand() < 0.55 ? -1 : 1;
      set(x, y, z, bark[Math.max(0, Math.min(4, shade))]);
    }
  }
}

// Dark, soft-looking hollow beneath the eggs.
for (let x = 12; x <= 36; x++) {
  for (let y = 12; y <= 36; y++) {
    const r = Math.hypot(x - cx, y - cy);
    if (r < 11.9 && get(x, y, 4)) {
      set(x, y, 5, rand() < 0.35 ? "#785036" : "#67412d");
    }
  }
}

// Individual curved sticks crossing the sides and woven over the rim.
for (let i = 0; i < 230; i++) {
  const a = rand() * Math.PI * 2;
  const sweep = (0.16 + rand() * 0.37) * (rand() < 0.5 ? -1 : 1);
  const z = 2 + Math.floor(rand() * 12);
  const radius = z < 5 ? 14.2 + rand() * 3.5 :
                 z < 10 ? 17 + rand() * 3 :
                          15.4 + rand() * 3.5;
  const rise = Math.round((rand() - 0.5) * 3);
  const x0 = cx + radius * Math.cos(a);
  const y0 = cy + radius * Math.sin(a);
  const x1 = cx + (radius + (rand() - 0.5) * 2.5) * Math.cos(a + sweep);
  const y1 = cy + (radius + (rand() - 0.5) * 2.5) * Math.sin(a + sweep);
  line(x0, y0, z, x1, y1, Math.max(1, Math.min(15, z + rise)),
       rand() < 0.16 ? 1 : 0, twig[Math.floor(rand() * twig.length)]);
}

// Short, loose ends sticking out from the edge.
for (let i = 0; i < 48; i++) {
  const a = rand() * Math.PI * 2;
  const z = 3 + Math.floor(rand() * 9);
  const r = z < 6 ? 17 : 18.3;
  const length = 1.5 + rand() * 2.2;
  line(cx + r * Math.cos(a), cy + r * Math.sin(a), z,
       cx + (r + length) * Math.cos(a + 0.11),
       cy + (r + length) * Math.sin(a + 0.11), z + (rand() < 0.5 ? 1 : -1),
       0, twig[Math.floor(rand() * twig.length)]);
}

// Three upright, slightly tapered eggs.
const eggs = [
  { x: 17.5, y: 19.5, z: 14, rx: 4.1, ry: 4.3, rz: 6.3 },
  { x: 30,   y: 20.5, z: 14, rx: 4.1, ry: 4.3, rz: 6.5 },
  { x: 24,   y: 28.5, z: 15, rx: 4.3, ry: 4.2, rz: 6.9 }
];

for (const e of eggs) {
  for (let z = Math.floor(e.z - e.rz); z <= Math.ceil(e.z + e.rz); z++) {
    const v = (z - e.z) / e.rz;
    const taper = 1 - 0.13 * v; // Narrower at the pointed top.
    for (let x = Math.floor(e.x - 5); x <= Math.ceil(e.x + 5); x++) {
      for (let y = Math.floor(e.y - 5); y <= Math.ceil(e.y + 5); y++) {
        const q = ((x - e.x) / (e.rx * taper)) ** 2 +
                  ((y - e.y) / (e.ry * taper)) ** 2 + v * v;
        if (q > 1) continue;

        let color = "#bce7e7";
        if (z < e.z - 2) color = "#91c8d1";
        else if (z > e.z + 2) color = "#d9f4e8";
        else if (x < e.x - 1 && y < e.y) color = "#d3f2ee";
        if (rand() < 0.07) color = "#a9d9dd";

        const surface = q > 0.68;
        if (surface && rand() < 0.095) {
          color = rand() < 0.65 ? "#77aebc" : "#95bdc0";
        }
        if (surface && x < e.x - 1 && y < e.y - 1 &&
            z > e.z && rand() < 0.14) color = "#f3fff4";
        set(x, y, z, color);
      }
    }
  }
}