← Basics3D assetfogon/mecedora-de-madera
Mecedora de madera
Drag to turn it// «Mecedora de madera» · gpt-6-sol (medium)
// Rocking chair («Mecedora de madera»).
const dark = "#79451f";
const shadow = "#965825";
const wood = "#b87536";
const warm = "#ca8945";
const light = "#e1a65f";
const edge = "#a7632d";
function timber(x0, y0, z0, x1, y1, z1, color = wood) {
box(x0, y0, z0, x1, y1, z1, color);
if (z1 > z0) box(x0, y0, z1, x1, y1, z1, light);
if (y1 > y0 && z1 > z0) box(x0, y0, z0, x1, y0, z1 - 1, shadow);
}
// Two long, gently upturned rocking runners.
for (const x of [11, 36]) {
for (let y = 5; y <= 43; y++) {
const d = Math.abs(y - 24);
const rise = d <= 9 ? 0 : Math.round((d - 9) * 0.45);
box(x, y, rise, x + 2, y, rise + 2, wood);
box(x, y, rise + 2, x + 2, y, rise + 2, warm);
set(x, y, rise, shadow);
}
// Squared, slightly thicker tips.
for (const y of [5, 6, 42, 43]) {
const rise = Math.round((Math.abs(y - 24) - 9) * 0.45);
box(x - 1, y, rise, x + 2, y, rise + 1, edge);
box(x, y, rise + 2, x + 2, y, rise + 2, light);
}
}
// Legs and their blocky joints to the rockers.
for (const x of [12, 37]) {
for (const y of [16, 32]) {
timber(x - 1, y - 1, 3, x + 1, y + 1, 20, wood);
box(x - 2, y - 2, 4, x + 2, y + 2, 5, shadow);
box(x - 1, y - 1, 6, x + 1, y + 1, 6, light);
box(x - 1, y - 1, 16, x + 1, y + 1, 17, edge);
}
}
// Low stretchers and diagonal braces beneath the seat.
for (const x of [12, 37]) {
timber(x, 17, 10, x + 1, 32, 11, edge);
line(x, 19, 10, x, 29, 17, 1, wood);
}
timber(13, 16, 10, 36, 17, 11, shadow);
timber(13, 32, 11, 36, 33, 12, shadow);
// Thick seat frame, with separate broad wooden planks.
timber(11, 14, 19, 38, 16, 21, wood);
timber(11, 32, 19, 38, 34, 21, wood);
timber(11, 16, 19, 13, 32, 21, wood);
timber(36, 16, 19, 38, 32, 21, wood);
for (let x = 14; x <= 35; x++) {
const plank = Math.floor((x - 14) / 5);
const color = [warm, "#d4944e", "#c98541", "#d99a54", warm][plank];
box(x, 17, 20, x, 31, 21, color);
if ((x - 14) % 5 === 0) {
box(x, 18, 21, x, 30, 21, shadow);
}
}
for (let i = 0; i < 13; i++) {
const x = 15 + Math.floor(rand() * 20);
const y = 18 + Math.floor(rand() * 13);
set(x, y, 22, rand() < 0.5 ? light : wood);
}
box(13, 15, 22, 36, 15, 22, light);
box(13, 33, 22, 36, 33, 22, edge);
// Tall rear uprights.
for (const x of [12, 37]) {
timber(x - 1, 32, 21, x + 1, 34, 40, wood);
box(x - 2, 32, 36, x + 2, 34, 37, shadow);
box(x - 2, 32, 39, x + 2, 34, 40, warm);
box(x - 1, 32, 41, x + 1, 34, 41, light);
}
// Turned spindles across the chair back.
for (const x of [17, 21, 25, 29, 33]) {
box(x, 33, 23, x, 34, 35, wood);
box(x, 33, 24, x, 34, 25, light);
box(x - 1, 33, 28, x + 1, 34, 29, warm);
box(x, 33, 31, x, 34, 33, light);
box(x - 1, 33, 34, x + 1, 34, 35, shadow);
}
// Heavy crested top rail with a raised central lip.
timber(12, 32, 36, 37, 35, 39, wood);
box(15, 32, 40, 34, 34, 40, warm);
box(17, 32, 41, 33, 34, 41, light);
box(14, 31, 36, 35, 31, 36, dark);
// Broad arms, supported by little front posts.
for (const x of [11, 38]) {
timber(x - 1, 16, 21, x + 1, 18, 27, wood);
box(x - 2, 15, 26, x + 2, 19, 27, shadow);
timber(x - 2, 15, 28, x + 2, 33, 29, warm);
box(x - 2, 15, 30, x + 2, 32, 30, light);
box(x - 2, 14, 28, x + 2, 16, 30, wood);
box(x - 2, 14, 31, x + 2, 16, 31, light);
line(x, 21, 22, x, 27, 28, 0, shadow);
}
// A few dark mortise details make the joinery readable.
for (const x of [12, 37]) {
set(x, 14, 19, dark);
set(x, 32, 16, dark);
set(x, 16, 28, edge);
}import { draw } from "./assets/voxel";
import { mecedoraDeMadera } from "./assets/mecedora-de-madera";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, mecedoraDeMadera, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: its longest side, in px
// angle: turn on the floor, in radians
// t: seconds; if it moves, that animates it# In a terminal, in the game's folder
fogon assets add mecedora-de-madera
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["mecedora-de-madera"] })
# It lands in client/assets/mecedora-de-madera.ts
# https://fogon.page/object/mecedora-de-madera