← BásicoObjeto 3Dfogon/cajon-de-listones
Cajón de listones
Arrastrá para girarlo// «Cajón de listones» · gpt-6-sol (medium)
// Slatted crate («Cajón de listones»).
// Open slatted wooden crate
const wood = {
dark: "#754922",
shadow: "#915b28",
side: "#a96c2e",
front: "#b87833",
light: "#d49345",
edge: "#e3a853"
};
const iron = "#303c40";
const ironLight = "#536267";
// Recessed plank floor, visible through the open top.
box(9, 9, 1, 38, 38, 2, wood.dark);
for (let y = 10; y <= 37; y += 6) {
box(10, y, 3, 37, Math.min(y + 5, 37), 3, wood.shadow);
line(10, y, 3, 37, y, 3, 0, wood.side);
}
// Four tiers of solid slats, separated by open gaps.
for (const z of [3, 11, 19, 27]) {
box(9, 6, z, 38, 8, z + 4, wood.front);
box(9, 39, z, 38, 41, z + 4, wood.shadow);
box(6, 9, z, 8, 38, z + 4, wood.side);
box(39, 9, z, 41, 38, z + 4, wood.shadow);
// Sunlit upper edges and darker lower edges.
box(10, 6, z + 4, 37, 8, z + 4, wood.light);
box(10, 6, z, 37, 6, z, wood.shadow);
box(10, 39, z + 4, 37, 41, z + 4, wood.side);
box(6, 10, z + 4, 8, 37, z + 4, wood.light);
box(39, 10, z + 4, 41, 37, z + 4, wood.side);
}
// Heavy corner uprights.
for (const x of [6, 38]) for (const y of [6, 38]) {
box(x, y, 0, x + 3, y + 3, 34, wood.shadow);
box(x, y, 2, x + 3, y, 32, wood.front);
box(x, y, 2, x, y + 3, 32, wood.dark);
box(x, y, 34, x + 3, y + 3, 34, wood.light);
}
// Handholds cut through the upper slats.
for (let x = 19; x <= 28; x++) {
for (let y = 6; y <= 8; y++) set(x, y, 28, null);
for (let y = 39; y <= 41; y++) set(x, y, 28, null);
}
for (let y = 19; y <= 28; y++) {
for (let x = 6; x <= 8; x++) set(x, y, 28, null);
for (let x = 39; x <= 41; x++) set(x, y, 28, null);
}
box(19, 6, 27, 28, 6, 27, wood.dark);
box(19, 39, 29, 28, 41, 29, wood.dark);
box(39, 19, 27, 41, 28, 27, wood.dark);
// Thick, open rectangular top rim.
box(6, 6, 32, 41, 9, 35, wood.light);
box(6, 38, 32, 41, 41, 35, wood.light);
box(6, 10, 32, 9, 37, 35, wood.edge);
box(38, 10, 32, 41, 37, 35, wood.light);
box(10, 9, 32, 37, 9, 34, wood.dark);
box(10, 38, 32, 37, 38, 34, wood.shadow);
box(9, 10, 32, 9, 37, 34, wood.dark);
box(38, 10, 32, 38, 37, 34, wood.shadow);
line(7, 6, 35, 40, 6, 35, 0, wood.edge);
line(6, 7, 35, 6, 40, 35, 0, wood.edge);
// Sparse horizontal grain and flecks on the outward-facing boards.
for (const z0 of [3, 11, 19, 27]) {
for (let i = 0; i < 44; i++) {
const x = 10 + Math.floor(rand() * 26);
const y = 10 + Math.floor(rand() * 26);
const z = z0 + Math.floor(rand() * 4);
const length = 1 + Math.floor(rand() * 4);
const c = rand() < 0.55 ? wood.shadow : wood.light;
for (let d = 0; d < length; d++) {
if (get(x + d, 6, z)) set(x + d, 6, z, c);
if (get(41, y + d, z)) set(41, y + d, z, c);
}
}
}
// Steel L-shaped corner straps, wrapped around top and bottom.
for (const x of [6, 38]) for (const y of [6, 38]) {
const sx = x === 6 ? -1 : 1;
const sy = y === 6 ? -1 : 1;
for (const z of [0, 30]) {
const outsideY = y === 6 ? 5 : 42;
const outsideX = x === 6 ? 5 : 42;
box(x - (sx < 0 ? 0 : 3), outsideY, z,
x + (sx < 0 ? 6 : 3), outsideY, z + 2, iron);
box(outsideX, y - (sy < 0 ? 0 : 3), z,
outsideX, y + (sy < 0 ? 6 : 3), z + 2, iron);
set(x + (sx < 0 ? 4 : -4), outsideY, z + 2, ironLight);
set(outsideX, y + (sy < 0 ? 4 : -4), z + 2, ironLight);
}
}
// Dark square fasteners at the ends of each plank.
for (const z of [5, 13, 21, 29]) {
for (const x of [12, 35]) {
set(x, 5, z, iron);
set(x, 42, z, iron);
set(x, 5, z + 1, ironLight);
}
for (const y of [12, 35]) {
set(5, y, z, iron);
set(42, y, z, iron);
set(42, y, z + 1, ironLight);
}
}import { draw } from "./assets/voxel";
import { cajonDeListones } from "./assets/cajon-de-listones";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, cajonDeListones, 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 cajon-de-listones
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["cajon-de-listones"] })
# Queda en client/assets/cajon-de-listones.ts
# https://fogon.page/object/cajon-de-listones