fogón

← Antiguo y prehistoriaObjeto 3Dfogon/huevo-de-dinosaurio

Huevo de dinosaurio

de fogonCC016973 bloques
Huevo de dinosaurioArrastrá para girarlo
// «Huevo de dinosaurio» · gpt-6-sol (medium)
// A giant cartoon dinosaur egg standing upright on z=0, oval and taller than wide, cream with green and brown speckles, with a zigzag crack across the top where a little green baby dino head peeks out with big eyes. It sits in a small ring of sand and pebbles.

// A little nest of warm sand around the egg.
for (let x = 2; x <= 46; x++) {
  for (let y = 4; y <= 44; y++) {
    const d = Math.sqrt(((x - 24) / 20) ** 2 + ((y - 24) / 17) ** 2);
    if (d > 0.79 && d < 1.08 && rand() > 0.12) {
      set(x, y, 0, rand() < 0.28 ? "#d4aa70" : "#e9c58b");
      if (d > 0.9 && rand() < 0.16)
        set(x, y, 1, "#f0d39c");
    }
  }
}
for (let i = 0; i < 85; i++) {
  const a = rand() * Math.PI * 2;
  const r = 0.83 + rand() * 0.22;
  const x = Math.round(24 + Math.cos(a) * 20 * r);
  const y = Math.round(24 + Math.sin(a) * 17 * r);
  const c = ["#ad9677", "#8e927c", "#c49b6d", "#eee0bb"][Math.floor(rand() * 4)];
  set(x, y, 1, c);
  if (rand() < 0.25) set(x + 1, y, 1, c);
}

// The front half of the shell has a jagged, broken-open upper edge.
const zig = [0, 1, 2, 3, 2, 1, 0, -1, -2, -1, 0, 1];
function rim(x) {
  return 32 + zig[((x - 9) % zig.length + zig.length) % zig.length];
}
function insideEgg(x, y, z) {
  return ((x - 24) / 15) ** 2 +
         ((y - 24) / 13) ** 2 +
         ((z - 20) / 20) ** 2 <= 1;
}
function shellExists(x, y, z) {
  if (!insideEgg(x, y, z)) return false;
  if (y <= 26 && z > rim(x)) return false;
  if (y <= 31 && x >= 18 && x <= 30 && z > 32) return false;
  return true;
}

for (let z = 0; z <= 40; z++) {
  for (let y = 11; y <= 37; y++) {
    for (let x = 9; x <= 39; x++) {
      if (!shellExists(x, y, z)) continue;
      let c = z > 30 ? "#f7eccd" : z < 11 ? "#d5c39d" : "#ecdfbd";
      if (rand() < 0.09) c = "#fff0d2";
      if (rand() < 0.045) c = "#ddcca6";
      set(x, y, z, c);
    }
  }
}

// A dark line beneath the bright, chunky zigzag lip.
for (let x = 12; x <= 36; x++) {
  for (let y = 11; y <= 26; y++) {
    const top = rim(x);
    if (get(x, y, top) && !get(x, y - 1, top)) {
      set(x, y, top, "#fff2d5");
      if (get(x, y, top - 1)) set(x, y, top - 1, "#977e60");
      if (get(x, y, top - 2)) set(x, y, top - 2, "#cfb996");
    }
  }
}

// Irregular olive and earthy-brown speckles, concentrated on visible shell.
const spots = ["#84916a", "#687b55", "#af8a65", "#8c7057"];
for (let i = 0; i < 105; i++) {
  const x = 11 + Math.floor(rand() * 27);
  const z = 5 + Math.floor(rand() * 28);
  let front;
  for (let y = 10; y <= 37; y++) {
    if (get(x, y, z)) { front = y; break; }
  }
  if (front === undefined || front > 32) continue;
  const c = spots[Math.floor(rand() * spots.length)];
  set(x, front, z, c);
  if (rand() < 0.49 && get(x + 1, front, z))
    set(x + 1, front, z, c);
  if (rand() < 0.30 && get(x, front, z + 1))
    set(x, front, z + 1, c);
}

// The hatchling bobs gently above the cracked shell.
part("baby head", [24, 23, 32]);
ellipsoid(24, 23, 33, 4, 4, 6, "#668c50");
ellipsoid(24, 19, 38, 7, 6, 6, "#79a85c");
ellipsoid(24, 17, 41, 6, 4, 2, "#91bf70");
ellipsoid(24, 14, 36, 5, 5, 3, "#91ba69");
ellipsoid(24, 12, 37, 4, 3, 2, "#a4cb7b");

// Friendly raised brow ridges and large forward-facing eyes.
for (const x of [20, 28]) {
  box(x - 2, 13, 40, x + 1, 14, 42, "#5e854b");
  box(x - 1, 12, 39, x + 1, 12, 41, "#fff8e3");
  box(x, 11, 39, x + 1, 11, 40, "#202c25");
  set(x, 10, 41, "#ffffff");
}
set(22, 9, 37, "#4c6843");
set(26, 9, 37, "#4c6843");
line(21, 9, 34, 27, 9, 34, 0, "#4d7145");
set(20, 10, 35, "#4d7145");
set(28, 10, 35, "#4d7145");

// Three soft, rounded bumps on the crown.
sphere(19, 20, 43, 2, "#648d51");
sphere(24, 21, 44, 2, "#6c9855");
sphere(29, 20, 43, 2, "#648d51");

animate("baby head", { type: "bob", axis: "z", speed: 3, amplitude: 1.5 });