fogón

← Ancient and prehistory3D assetfogon/nido-de-dinosaurio

Nido de dinosaurio

by fogonCC011984 blocks
Nido de dinosaurioDrag to turn it
// «Nido de dinosaurio» · gpt-6-sol (medium)
// A big round dinosaur nest on the ground: a wide low ring of twigs, dry grass and mud in browns and straw yellows, with four large speckled eggs (pale blue, cream, pale green) resting inside. A few leaves and feathers scattered around the rim.

// A broad, low dinosaur nest with a raised, grassy rim.
const mud = ["#594331", "#705139", "#866047", "#9a7150"];
const straw = ["#ae874b", "#c7a15c", "#d8b56e", "#e8cb87"];
const cx = 24, cy = 24;

for (let x = 2; x <= 46; x++) {
  for (let y = 2; y <= 46; y++) {
    const dx = x - cx, dy = y - cy;
    const r = Math.hypot(dx, dy);
    const a = Math.atan2(dy, dx);
    const edge = 20.7 + 0.65 * Math.sin(7 * a) + 0.35 * Math.sin(13 * a + 1);
    if (r > edge) continue;

    const ridge = 6.3 * Math.exp(-Math.pow((r - 17.2) / 4.0, 2));
    const top = Math.max(2, Math.round(2 + ridge + (rand() - 0.5) * 1.4));
    for (let z = 0; z <= top; z++) {
      let color;
      if (z === top) {
        color = r > 11 && rand() < 0.75
          ? straw[Math.floor(rand() * straw.length)]
          : mud[2 + Math.floor(rand() * 2)];
      } else {
        color = mud[Math.min(3, Math.floor(z / 3) + (rand() < 0.1 ? 1 : 0))];
      }
      set(x, y, z, color);
    }
  }
}

// Tangled, chunky twigs follow the ring rather than hiding the eggs.
for (let i = 0; i < 155; i++) {
  const a = rand() * Math.PI * 2;
  const r = 14.1 + rand() * 6.0;
  const length = 2 + rand() * 4;
  const turn = (rand() - 0.5) * 0.65;
  const x = cx + Math.cos(a) * r;
  const y = cy + Math.sin(a) * r;
  const z = 4 + 3.5 * Math.exp(-Math.pow((r - 17.2) / 4, 2));
  const tint = ["#694a33", "#8b633c", "#aa7d45", "#c69a55", "#dfb96e"];
  line(
    x - Math.sin(a + turn) * length / 2,
    y + Math.cos(a + turn) * length / 2,
    z,
    x + Math.sin(a + turn) * length / 2,
    y - Math.cos(a + turn) * length / 2,
    z + (rand() - 0.5) * 2,
    rand() < 0.15 ? 1 : 0,
    tint[Math.floor(rand() * tint.length)]
  );
}

// Short loose grasses, including some on the inner bed.
for (let i = 0; i < 125; i++) {
  const a = rand() * Math.PI * 2;
  const r = rand() < 0.27 ? rand() * 11 : 12 + rand() * 8;
  const x = cx + Math.cos(a) * r;
  const y = cy + Math.sin(a) * r;
  const z = Math.round(2 + 6.3 * Math.exp(-Math.pow((r - 17.2) / 4, 2)));
  const c = straw[Math.floor(rand() * straw.length)];
  line(x, y, z, x + (rand() - 0.5) * 2, y + (rand() - 0.5) * 2,
       z + 1 + Math.floor(rand() * 2), 0, c);
}

// Four upright eggs, broad at the bottom and gently tapered at the top.
function egg(ex, ey, base, light, shade, spots) {
  const ez = 11, rx = 5.1, ry = 4.7, rz = 8.4;
  for (let x = Math.floor(ex - 6); x <= Math.ceil(ex + 6); x++) {
    for (let y = Math.floor(ey - 6); y <= Math.ceil(ey + 6); y++) {
      for (let z = 3; z <= 20; z++) {
        const t = (z - ez) / rz;
        const taper = 1 - 0.17 * t;
        const q = Math.pow((x - ex) / (rx * taper), 2)
                + Math.pow((y - ey) / (ry * taper), 2) + t * t;
        if (q > 1) continue;

        let color = base;
        if (z >= 13 && (y <= ey || rand() < 0.35)) color = light;
        if (z <= 7 || (x > ex + 2 && rand() < 0.5)) color = shade;
        if (q > 0.69 && rand() < 0.075) color = spots;
        set(x, y, z, color);
      }
    }
  }
  // A little gleam on the viewer-facing curve.
  set(ex - 2, ey - 4, 14, "#f8f5dd");
  set(ex - 2, ey - 4, 15, "#f8f5dd");
}

egg(17, 29, "#b9cdb2", "#d9e6c8", "#91aa90", "#6f8c77");
egg(30, 29, "#a7c8c5", "#d4e8db", "#84aaa8", "#658c91");
egg(16, 17, "#afcfda", "#dceef0", "#87adbe", "#648d9f");
egg(30, 17, "#e1d5ad", "#f5ebce", "#bfb089", "#9e9475");

// Broad leaves with dark veins, scattered around the exposed rim.
const leaves = [
  [7, 19, 7, -1, -2], [10, 36, 6, 2, -1],
  [39, 33, 7, 2, 1], [37, 10, 6, -2, 1],
  [22, 43, 5, 1, -2]
];
for (const [x, y, z, dx, dy] of leaves) {
  line(x - dx, y - dy, z, x + dx, y + dy, z + 1, 1, "#536744");
  line(x, y, z + 1, x + dx, y + dy, z + 1, 0, "#9ba865");
  set(x + dx, y + dy, z + 1, "#7d9856");
}

// Two small fallen feathers, with pale shafts and tapered barbs.
function feather(x, y, z, dx, dy) {
  line(x, y, z, x + dx * 4, y + dy * 4, z + 1, 0, "#eee0b3");
  for (let i = 1; i <= 3; i++) {
    const px = x + dx * i, py = y + dy * i;
    const width = i === 2 ? 2 : 1;
    line(px, py, z + 1, px - dy * width, py + dx * width, z + 1,
         0, "#c8b68b");
    line(px, py, z + 1, px + dy * width, py - dx * width, z + 1,
         0, "#d9c79b");
  }
}
feather(9, 12, 5, 1, 0);
feather(37, 39, 5, -1, 0);