← BásicoObjeto 3Dfogon/cofre-del-tesoro-v2
Cofre del tesoro
Arrastrá 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 boards and pale iron fittings.
const wood = "#8e4528";
const darkWood = "#552b1c";
const iron = "#a8b8b9";
const brightIron = "#d8e1dc";
const darkIron = "#59696b";
// Solid lower chest.
box(6, 7, 2, 41, 32, 19, wood);
box(7, 8, 3, 40, 31, 5, darkWood);
// Subtle variation across the broad wooden faces.
for (let x = 8; x <= 39; x++) {
for (let z = 4; z <= 18; z++) {
if (rand() < 0.13) set(x, 6, z, rand() < 0.5 ? "#a8552b" : "#713820");
}
}
for (let y = 9; y <= 30; y++) {
for (let z = 5; z <= 18; z++) {
if (rand() < 0.12) set(5, y, z, rand() < 0.5 ? "#aa542a" : "#71391f");
}
}
// Plank seams and inset front panels.
for (const z of [7, 13]) box(8, 6, z, 39, 6, z, "#69351f");
box(14, 5, 5, 36, 5, 16, "#99502b");
box(16, 4, 7, 34, 4, 14, "#b06131");
for (const z of [8, 12]) box(16, 3, z, 34, 3, z, "#9b4d26");
box(16, 4, 6, 34, 4, 6, "#69331e");
box(16, 4, 15, 34, 4, 15, "#69331e");
box(15, 4, 6, 15, 4, 15, "#65321e");
box(35, 4, 6, 35, 4, 15, "#65321e");
// Left end panels and their dark board joints.
for (const y of [13, 23]) box(4, y, 5, 4, y, 17, "#60321e");
box(4, 10, 7, 4, 29, 7, "#ac572d");
box(4, 10, 14, 4, 29, 14, "#71371f");
// The open cavity, with a thick, shadowed interior.
box(9, 10, 13, 38, 29, 20, "#321b15");
box(10, 11, 13, 37, 28, 13, "#794024");
box(10, 11, 14, 37, 28, 14, "#45251a");
box(9, 10, 14, 9, 29, 19, "#753a23");
box(38, 10, 14, 38, 29, 19, "#4b261b");
box(10, 10, 14, 37, 10, 19, "#703820");
box(10, 29, 14, 37, 29, 19, "#291813");
box(11, 12, 15, 36, 27, 20, null);
// Raised iron rim around the opening.
box(5, 6, 19, 42, 9, 20, darkIron);
box(6, 6, 20, 41, 7, 20, brightIron);
box(6, 8, 20, 41, 9, 20, iron);
box(5, 30, 19, 42, 33, 20, darkIron);
box(6, 31, 20, 41, 32, 20, iron);
box(5, 8, 19, 8, 31, 20, iron);
box(6, 9, 20, 7, 30, 20, brightIron);
box(39, 8, 19, 42, 31, 20, iron);
box(40, 9, 20, 41, 30, 20, brightIron);
// Feet and continuous lower iron edging.
box(7, 8, 0, 11, 12, 2, "#45332b");
box(36, 8, 0, 40, 12, 2, "#45332b");
box(7, 27, 0, 11, 31, 2, "#45332b");
box(36, 27, 0, 40, 31, 2, "#45332b");
box(5, 5, 2, 42, 8, 3, darkIron);
box(6, 5, 3, 41, 5, 3, brightIron);
box(5, 6, 3, 6, 32, 3, iron);
box(41, 6, 3, 42, 32, 3, iron);
box(6, 31, 3, 41, 33, 3, darkIron);
box(6, 32, 3, 41, 32, 3, iron);
// Chunky vertical corner straps, with shaded sides.
for (const x of [7, 39]) {
box(x, 4, 3, x + 2, 6, 19, darkIron);
box(x, 4, 5, x + 1, 4, 18, brightIron);
box(x + 2, 5, 5, x + 2, 5, 18, iron);
for (const z of [6, 17]) set(x + 1, 3, z, "#59676a");
}
for (const y of [9, 29]) {
box(4, y, 3, 5, y + 2, 19, darkIron);
box(3, y, 5, 3, y + 1, 18, brightIron);
}
// Iron handle on the visible left end.
box(2, 15, 9, 3, 23, 15, darkIron);
box(2, 16, 10, 2, 22, 14, iron);
box(1, 17, 10, 1, 21, 10, brightIron);
box(1, 17, 14, 1, 21, 14, brightIron);
box(1, 17, 11, 1, 17, 13, iron);
box(1, 21, 11, 1, 21, 13, iron);
box(1, 18, 11, 1, 20, 13, "#3b2923");
for (const y of [14, 24]) set(2, y, 12, brightIron);
// Central hasp and dark keyhole.
box(22, 3, 11, 27, 5, 19, darkIron);
box(23, 2, 12, 26, 3, 18, iron);
box(23, 2, 17, 26, 2, 18, brightIron);
box(23, 2, 12, 23, 2, 16, brightIron);
box(25, 1, 13, 26, 1, 16, "#465154");
set(25, 0, 15, "#222528");
set(25, 0, 14, "#222528");
// Lid hinged along the back edge. Its rising plank surface
// leaves the chest's dark opening plainly visible.
for (let y = 31; y <= 45; y++) {
const z = 22 + Math.round((y - 31) * 0.91);
box(5, y, z - 2, 42, y, z, "#63331f");
box(7, y, z, 40, y, z, "#ac5428");
box(9, y, z + 1, 38, y, z + 1, "#bd6530");
// Long parallel wood grain, broken up without obscuring the planks.
for (const x of [15, 22, 29, 35]) {
set(x, y, z + 1, x % 2 ? "#cf7135" : "#93431f");
}
for (let x = 10; x <= 37; x++) {
if (rand() < 0.09) set(x, y, z + 1, rand() < 0.5 ? "#d17438" : "#96441f");
}
// Iron rails along both ends and two bands across the lid.
for (const x of [5, 6, 12, 13, 37, 38, 41, 42]) {
set(x, y, z + 1, x === 5 || x === 12 || x === 37 ? brightIron : iron);
set(x, y, z, darkIron);
}
}
// Metal edging on the near and far ends of the raised lid.
for (const y of [31, 45]) {
const z = 22 + Math.round((y - 31) * 0.91);
box(5, y, z - 2, 42, y, z - 2, darkIron);
box(6, y, z - 1, 41, y, z - 1, iron);
for (const x of [6, 12, 13, 37, 38, 41]) {
set(x, y, z + 2, brightIron);
}
}
box(20, 30, 21, 27, 31, 22, darkIron);
box(22, 29, 22, 25, 30, 23, brightIron);import { draw } from "./assets/voxel";
import { cofreDelTesoroV2 } from "./assets/cofre-del-tesoro-v2";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, cofreDelTesoroV2, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: lo que mide en px su lado más largo
// angle: giro sobre el piso, en radianes
// t: segundos; si se mueve, se anima solo con eso# En una terminal, en la carpeta del juego
fogon assets add cofre-del-tesoro-v2
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["cofre-del-tesoro-v2"] })
# Queda en client/assets/cofre-del-tesoro-v2.ts
# https://fogon.page/object/cofre-del-tesoro-v2