fogón

← Parties and Christmas3D assetfogon/pesebre

Pesebre

by fogonCC014783 blocks
PesebreDrag to turn it
// «Pesebre» · gpt-6-sol (medium)
// A small nativity scene: a simple wooden stable with a sloped straw roof and a bright star on top, open at the front (-y). Inside, a wooden manger with straw and a baby wrapped in white, with Mary in blue and Joseph in brown kneeling at either side, and a little donkey and an ox lying at the back.

const wood = "#9b5732", woodLight = "#c27a43", woodDark = "#70402b";
const straw = "#e7b94c", strawLight = "#ffe18a", strawDark = "#bc8734";
const snow = "#fff9ed";

// A low, snowy wooden platform.
box(6, 7, 0, 42, 41, 1, "#e8e0cb");
box(8, 9, 2, 40, 39, 2, "#b98553");
for (let y = 10; y <= 38; y += 4) {
  line(9, y, 2, 39, y, 2, 0, "#d09b62");
}
for (let x = 6; x <= 42; x++) {
  set(x, 7, 2, x % 5 === 0 ? "#dce9ec" : snow);
  set(x, 41, 2, snow);
}
for (let y = 8; y <= 40; y++) {
  set(6, y, 2, snow);
  set(42, y, 2, snow);
}

// Rear wall and the open stable's chunky timber frame.
box(8, 39, 3, 40, 40, 24, "#e4c793");
for (let x = 10; x <= 38; x += 5) {
  box(x, 38, 4, x, 38, 23, "#d7ae75");
}
for (const x of [8, 40]) {
  for (const y of [8, 39]) {
    box(x - 1, y - 1, 2, x + 1, y + 1, 29, woodDark);
    box(x, y - 1, 3, x + 1, y, 28, wood);
    for (let z = 7; z < 28; z += 6) set(x, y - 2, z, woodLight);
  }
}
box(8, 7, 25, 40, 9, 27, woodDark);
box(9, 6, 26, 39, 6, 27, woodLight);
box(8, 38, 24, 40, 40, 26, wood);
for (const x of [8, 40]) {
  line(x, 11, 13, x, 25, 25, 1, woodLight);
  box(x - 1, 26, 3, x + 1, 39, 9, wood);
}

// Gabled roof: thick straw, with ridges and little patches of snow.
for (let x = 5; x <= 43; x++) {
  const top = Math.round(36 - Math.abs(x - 24) * 0.42);
  for (let y = 6; y <= 41; y++) {
    for (let z = top - 2; z <= top; z++) {
      let color = z === top ? strawLight : z === top - 1 ? straw : strawDark;
      if (z === top && rand() < 0.18) color = "#f5cb62";
      if (z === top && ((y < 10 && rand() < 0.27) ||
          (y > 36 && rand() < 0.18) || (x > 34 && rand() < 0.09))) {
        color = rand() < 0.4 ? "#e8f4ef" : snow;
      }
      set(x, y, z, color);
    }
  }
}
for (let y = 7; y <= 40; y += 5) {
  for (let x = 7; x <= 41; x++) {
    const z = Math.round(36 - Math.abs(x - 24) * 0.42);
    if (rand() < 0.75) set(x, y, z + 1, x % 3 ? "#f6d475" : strawLight);
  }
}
line(24, 6, 36, 24, 41, 36, 1, strawDark);
line(24, 7, 37, 24, 40, 37, 0, snow);
line(6, 5, 28, 24, 5, 36, 1, wood);
line(24, 5, 36, 42, 5, 28, 1, wood);
line(7, 5, 29, 23, 5, 36, 0, strawLight);
line(25, 5, 36, 41, 5, 29, 0, strawLight);

// A festive garland and warm lights along the open front.
for (let x = 11; x <= 37; x++) {
  const z = 25 - Math.round(2 * Math.sin((x - 11) * Math.PI / 26));
  set(x, 5, z, x % 3 ? "#23894d" : "#44b769");
  if (x % 6 === 0) {
    sphere(x, 4, z - 1, 1, "#ffe79a");
    set(x, 3, z - 1, "#fffbd2");
  }
}
box(22, 5, 25, 26, 5, 26, "#d93646");
set(24, 4, 26, "#ffe57e");

// A manger at the very front, with its legs and golden straw.
for (const x of [20, 28]) {
  line(x, 12, 3, x + (x === 20 ? 2 : -2), 18, 9, 1, woodDark);
  line(x, 18, 3, x + (x === 20 ? 2 : -2), 12, 9, 1, wood);
}
box(19, 12, 7, 29, 19, 8, woodDark);
box(19, 12, 8, 29, 13, 11, woodLight);
box(19, 18, 8, 29, 19, 11, wood);
box(19, 13, 8, 20, 18, 10, wood);
box(28, 13, 8, 29, 18, 10, wood);
box(21, 14, 9, 27, 17, 10, straw);
for (let i = 0; i < 32; i++) {
  const x = 20 + Math.floor(rand() * 9);
  const y = 12 + Math.floor(rand() * 8);
  set(x, y, 11, rand() < 0.5 ? strawLight : strawDark);
}

// Baby, lying snugly in a white swaddle, face toward the viewer.
ellipsoid(24, 16, 12, 3, 2.5, 1.8, "#dae9ed");
ellipsoid(24, 15, 13, 2.7, 2.5, 1.5, "#fffdf6");
ellipsoid(24, 12, 13, 1.7, 1.5, 1.7, "#f5bd94");
set(23, 10, 14, "#6e443a");
set(25, 10, 14, "#6e443a");
set(24, 10, 12, "#dc8e84");
line(22, 15, 14, 26, 17, 12, 0, "#b9d8df");

// Mary kneels to the left, in a bright blue robe and pale-blue veil.
ellipsoid(14, 22, 5, 4.4, 4, 2.5, "#1657b6");
ellipsoid(14, 22, 9, 3.5, 3, 5.5, "#2981dc");
ellipsoid(14, 20, 12, 3.2, 2.5, 3, "#3694eb");
ellipsoid(14, 21, 17, 3, 2.6, 3.6, "#1464bc");
ellipsoid(14, 18.6, 17, 2.1, 1.4, 2.6, "#ffd0aa");
ellipsoid(14, 20.5, 19.6, 3, 2.5, 1.3, "#75c8f1");
for (const x of [11, 17]) {
  line(x, 19, 19, x, 18, 12, 1, "#75c8f1");
}
set(13, 17, 18, "#473a40");
set(15, 17, 18, "#473a40");
set(14, 17, 16, "#d77c76");
line(16, 19, 12, 19, 16, 11, 1, "#2981dc");
sphere(19, 16, 11, 1, "#ffd0aa");

// Joseph kneels on the right, in warm brown with a green sash.
ellipsoid(34, 23, 5, 4.5, 4, 2.5, "#724532");
ellipsoid(34, 22, 9, 3.5, 3, 5.5, "#a8643a");
ellipsoid(34, 20, 12, 3.2, 2.5, 3, "#bd7544");
box(32, 18, 8, 36, 19, 9, "#388f59");
ellipsoid(34, 20, 17, 2.6, 2.4, 3.1, "#f1bc91");
ellipsoid(34, 19, 19, 2.7, 2, 1.6, "#64402f");
ellipsoid(34, 18, 15.7, 2, 1.2, 1.3, "#805038");
set(33, 17, 18, "#453832");
set(35, 17, 18, "#453832");
line(32, 19, 12, 29, 16, 11, 1, "#a8643a");
sphere(29, 16, 11, 1, "#f1bc91");

// A little grey donkey rests against the back wall.
ellipsoid(15, 32, 6, 4.7, 4, 3.2, "#899ba4");
ellipsoid(15, 31, 8, 4, 3.3, 2.5, "#a5b5b7");
for (const x of [12, 18]) {
  ellipsoid(x, 28, 4, 1.5, 2.2, 1.7, "#748b96");
}
ellipsoid(15, 28, 11, 2.6, 2.4, 3.4, "#9aadb2");
ellipsoid(15, 25.5, 10, 2.2, 1.2, 1.6, "#d7dad1");
for (const x of [13, 17]) {
  line(x, 29, 13, x + (x < 15 ? -1 : 1), 29, 18, 1, "#899ba4");
  line(x, 27, 15, x + (x < 15 ? -1 : 1), 28, 18, 0, "#d6a9ab");
}
set(13, 25, 12, "#292f39");
set(17, 25, 12, "#292f39");
set(14, 24, 10, "#6f7479");
set(16, 24, 10, "#6f7479");

// A round, sleepy ox lies beside it.
ellipsoid(33, 33, 6, 5, 4.2, 3.3, "#b77a49");
ellipsoid(33, 32, 8, 4.3, 3.3, 2.5, "#d39a60");
ellipsoid(30, 32, 9, 1.6, 2, 1.3, "#fff0ce");
for (const x of [30, 36]) {
  ellipsoid(x, 29, 4, 1.7, 2.2, 1.6, "#a56841");
}
ellipsoid(33, 28, 11, 3, 2.7, 3, "#cb8d56");
ellipsoid(33, 25.4, 10, 2.7, 1.4, 1.7, "#e9b5a0");
for (const x of [30, 36]) {
  line(x, 29, 13, x + (x < 33 ? -2 : 2), 28, 16, 1, "#fff1d5");
  ellipsoid(x + (x < 33 ? -1 : 1), 28, 12, 1.3, 1, 1, "#a66c48");
}
set(31, 25, 12, "#3e3834");
set(35, 25, 12, "#3e3834");
set(32, 24, 10, "#a96769");
set(34, 24, 10, "#a96769");

// The roof star is its own glowing, color-cycling part.
part("star", [24, 9, 39]);
const points = [
  [24, 46], [26, 42], [31, 42], [27, 40], [29, 36],
  [24, 39], [19, 36], [21, 40], [17, 42], [22, 42]
];
function insideStar(x, z) {
  let inside = false;
  for (let i = 0, j = points.length - 1; i < points.length; j = i++) {
    const a = points[i], b = points[j];
    if ((a[1] > z) !== (b[1] > z) &&
        x < (b[0] - a[0]) * (z - a[1]) / (b[1] - a[1]) + a[0]) {
      inside = !inside;
    }
  }
  return inside;
}
for (let x = 17; x <= 31; x++) {
  for (let z = 36; z <= 46; z++) {
    if (insideStar(x + 0.5, z + 0.5)) {
      for (let y = 7; y <= 10; y++) {
        set(x, y, z, y === 7 ? "#fff1a0" : "#e9a833");
      }
    }
  }
}
sphere(24, 6, 41, 1, "#fff7be");
animate("star", {
  type: "colors",
  palette: ["#f5ba3b", "#ffdd65", "#fff2a6", "#ffe279"],
  pattern: "pulse",
  glow: 0.9
});
part("body");