fogón

← BásicoObjeto 3Dfogon/cofre-del-tesoro-v6

Cofre del tesoro

de fogonCC017978 bloques
Cofre del tesoroArrastrá para girarlo
// «Cofre del tesoro» · gpt-6-sol (medium)
// Treasure chest («Cofre del tesoro»). One of several variations of this object: follow the reference picture closely.

// Open treasure chest: dark wooden planks, silver fittings, and bright loot.
const wood = ["#68371f", "#754027", "#814629", "#8c4b2a"];
const dark = "#492719";
const iron = "#aab7b6";
const bright = "#dce7e3";
const shadow = "#697b7c";

// Solid chest, with an open, dark-lined interior.
box(7, 10, 1, 41, 36, 20, dark);
box(8, 11, 3, 40, 35, 19, "#754027");
box(10, 13, 11, 38, 33, 21, null);
box(10, 13, 10, 38, 33, 10, "#35241b");

// Varied wooden planks on the front and sides.
for (let x = 8; x <= 40; x++) {
  for (let z = 3; z <= 18; z++) {
    const grain = (Math.floor(z / 4) + (rand() < 0.13 ? 1 : 0)) % wood.length;
    set(x, 10, z, z % 5 === 2 ? "#51301e" : wood[grain]);
    if (rand() < 0.13) set(x, 11, z, "#995431");
  }
}
for (let y = 11; y <= 35; y++) {
  for (let z = 3; z <= 18; z++) {
    set(7, y, z, z % 5 === 2 ? "#49291b" : wood[(Math.floor(z / 4) + 1) % 4]);
    set(41, y, z, z % 5 === 2 ? "#49291b" : wood[Math.floor(z / 4) % 4]);
  }
}
for (const z of [3, 8, 14, 19]) {
  box(8, 10, z, 40, 10, z, "#4b2b1e");
  box(7, 11, z, 7, 35, z, "#4b2b1e");
}

// Heavy bottom edging and the bright lip around the opening.
box(7, 9, 0, 41, 11, 1, shadow);
box(7, 9, 2, 41, 9, 2, iron);
box(7, 10, 20, 41, 12, 21, iron);
box(8, 10, 21, 40, 10, 21, bright);
box(7, 34, 20, 41, 37, 21, iron);
box(8, 34, 21, 40, 35, 21, bright);
box(7, 12, 20, 9, 34, 21, iron);
box(39, 12, 20, 41, 34, 21, iron);
box(8, 13, 21, 8, 33, 21, bright);
box(40, 13, 21, 40, 33, 21, bright);

// Iron corner straps, with small rivets.
for (const x of [10, 37]) {
  box(x, 9, 2, x + 2, 10, 19, shadow);
  box(x, 9, 4, x + 1, 9, 18, iron);
  box(x, 9, 19, x + 2, 11, 21, bright);
  for (const z of [5, 15]) set(x + 1, 8, z, bright);
}
for (const y of [14, 32]) {
  box(6, y, 3, 7, y + 2, 18, shadow);
  box(6, y, 5, 6, y + 1, 17, iron);
  set(5, y, 12, bright);
}

// Raised central lock plate and its dark keyhole.
box(24, 8, 11, 29, 9, 18, shadow);
box(25, 7, 12, 28, 8, 17, iron);
box(25, 7, 16, 28, 7, 17, bright);
box(26, 6, 13, 27, 6, 15, "#394343");
set(26, 6, 16, "#394343");
set(27, 6, 16, "#394343");

// Open lid: a thick wooden panel leaning back from the rear hinge.
for (let y = 31; y <= 39; y++) {
  const z = 20 + 2 * (y - 31);
  for (let x = 8; x <= 40; x++) {
    for (let dz = -1; dz <= 2; dz++) {
      const c = dz === 2
        ? (y % 3 === 0 ? "#94502b" : "#7b3d23")
        : wood[(y + (rand() < 0.1 ? 1 : 0)) % 4];
      set(x, y, z + dz, c);
    }
    if (x > 11 && x < 38 && y > 32 && y < 38 && rand() < 0.12)
      set(x, y, z + 2, "#a65930");
  }
  // Metal binding down both ends of the lid.
  box(7, y, z - 1, 9, y, z + 2, shadow);
  box(7, y, z + 2, 8, y, z + 2, iron);
  box(39, y, z - 1, 41, y, z + 2, shadow);
  box(40, y, z + 2, 41, y, z + 2, iron);
}
for (const y of [31, 39]) {
  const z = 20 + 2 * (y - 31);
  box(7, y, z + 2, 41, y, z + 3, iron);
  box(9, y, z + 3, 39, y, z + 3, bright);
}
// Parallel straps visible across the top edge.
for (const x of [13, 35]) {
  for (let y = 34; y <= 39; y++) {
    const z = 20 + 2 * (y - 31);
    box(x, y, z + 3, x + 2, y, z + 3, iron);
    set(x, y, z + 4, bright);
  }
}
box(27, 30, 23, 30, 31, 25, shadow);
box(27, 29, 24, 29, 30, 25, iron);

// Mound of chunky gold coins inside the chest.
ellipsoid(24, 24, 17, 12, 8, 5, "#b98721");
ellipsoid(24, 23, 20, 11, 7, 4, "#e5b529");
for (let i = 0; i < 105; i++) {
  const x = 14 + Math.floor(rand() * 22);
  const y = 16 + Math.floor(rand() * 16);
  const d = ((x - 24) / 12) ** 2 + ((y - 24) / 9) ** 2;
  if (d > 1) continue;
  const z = Math.round(21 + 3 * (1 - d) + rand() * 2);
  box(x, y, z, x + (rand() < 0.55 ? 1 : 2), y + 1, z,
      ["#f5d247", "#ffe36a", "#dca427", "#fff078"][Math.floor(rand() * 4)]);
  if (rand() < 0.3) set(x, y, z + 1, "#fff18b");
}

// A few prominent ruby and sapphire gems among the coins.
box(20, 19, 25, 24, 21, 26, "#a72749");
box(21, 18, 26, 23, 20, 27, "#e84e70");
set(22, 18, 28, "#ff9aab");
box(25, 27, 25, 28, 29, 26, "#227caf");
box(26, 27, 27, 28, 28, 28, "#46b9e1");
set(27, 27, 29, "#a0edfa");
box(31, 24, 24, 34, 26, 26, "#269b91");
set(32, 24, 27, "#85ead3");