← BásicoObjeto 3Dfogon/silla-windsor
Silla Windsor
Arrastrá para girarlo// «Silla Windsor» · gpt-6-sol (medium)
// Windsor chair («Silla Windsor»).
const oak = {
light: "#e4aa60",
honey: "#ca8740",
mid: "#ad6c32",
dark: "#794820",
shadow: "#593718"
};
function beam(x0, y0, z0, x1, y1, z1, radius = 1) {
line(x0, y0, z0, x1, y1, z1, radius, oak.mid);
line(x0, y0 - 1, z0 + 1, x1, y1 - 1, z1 + 1, 0, oak.light);
line(x0, y0 + 1, z0, x1, y1 + 1, z1, 0, oak.dark);
}
// Four splayed, turned legs. The feet spread beyond the seat.
for (const side of [-1, 1]) {
const xTop = 24 + side * 11;
const xFoot = 24 + side * 17;
for (const [yTop, yFoot] of [[17, 10], [32, 40]]) {
beam(xFoot, yFoot, 0, xTop, yTop, 20);
line(xFoot, yFoot, 0, xFoot, yFoot, 2, 1, oak.dark);
line(xTop, yTop, 16, xTop, yTop, 19, 1, oak.honey);
line(xTop, yTop - 1, 10, xTop, yTop - 1, 12, 0, oak.light);
}
}
// Low stretchers between the legs.
for (const side of [-1, 1]) {
const x = 24 + side * 14;
beam(x, 12, 7, x, 38, 7, 1);
box(x - 1, 11, 6, x + 1, 13, 8, oak.mid);
box(x - 1, 37, 6, x + 1, 39, 8, oak.mid);
}
beam(10, 25, 8, 38, 25, 8, 1);
line(11, 24, 9, 37, 24, 9, 0, oak.light);
// Shaped, thick wooden seat with clipped corners.
function inSeat(x, y) {
if (x < 9 || x > 40 || y < 12 || y > 35) return false;
const corner = (x < 12 || x > 37) && (y < 15 || y > 32);
return !corner;
}
for (let x = 9; x <= 40; x++) {
for (let y = 12; y <= 35; y++) {
if (!inSeat(x, y)) continue;
for (let z = 19; z <= 22; z++) {
let c = z === 19 ? oak.dark : z === 20 ? oak.mid :
z === 21 ? oak.honey : oak.light;
if (z === 22) {
const n = rand();
c = n < 0.12 ? "#bd7737" : n < 0.38 ? "#d89749" :
n < 0.79 ? "#e9ae63" : "#f0bb73";
}
set(x, y, z, c);
}
}
}
// Rounded-looking raised seat edge and subtly scooped central panel.
for (let x = 10; x <= 39; x++) {
for (let y = 13; y <= 34; y++) {
if (!inSeat(x, y)) continue;
const edge = !inSeat(x - 2, y) || !inSeat(x + 2, y) ||
!inSeat(x, y - 2) || !inSeat(x, y + 2);
if (edge) set(x, y, 23, rand() < 0.25 ? oak.honey : "#e4a45a");
}
}
for (let x = 13; x <= 36; x++) {
for (let y = 16; y <= 30; y++) {
const n = rand();
set(x, y, 22, n < 0.10 ? "#b97938" :
n < 0.36 ? "#dc9b50" : "#efb66b");
}
}
// Dark joinery line around the seat, particularly visible at its front.
for (let x = 12; x <= 37; x++) {
set(x, 12, 20, oak.shadow);
if (x % 6 !== 0) set(x, 13, 21, oak.mid);
}
for (let y = 16; y <= 31; y++) {
set(9, y, 20, oak.dark);
set(40, y, 20, oak.dark);
}
// Short irregular strokes suggest oak grain across the broad seat.
for (let i = 0; i < 75; i++) {
const x = 14 + Math.floor(rand() * 22);
const y = 16 + Math.floor(rand() * 15);
const length = 1 + Math.floor(rand() * 4);
const c = rand() < 0.48 ? "#d08b42" : "#f3bf78";
for (let j = 0; j < length && x + j <= 36; j++) {
if (rand() > 0.22) set(x + j, y, 22, c);
}
}
// Rear mounting rail, partly visible behind the seat.
beam(11, 34, 24, 38, 34, 24, 1);
line(13, 33, 25, 36, 33, 25, 0, oak.light);
// Windsor back: a tall, continuous arched bentwood hoop.
function archZ(x) {
const t = (x - 24.5) / 16.5;
return 24 + 20 * Math.sqrt(Math.max(0, 1 - t * t));
}
function backY(z) {
return 33 + (z - 24) * 0.19;
}
let previous = null;
for (let x = 8; x <= 41.01; x += 0.38) {
const z = archZ(x);
const y = backY(z);
if (previous) beam(previous.x, previous.y, previous.z, x, y, z, 1);
previous = { x, y, z };
}
beam(8, 33, 24, 8, 33, 29, 1);
beam(41, 33, 24, 41, 33, 29, 1);
// Narrow upright spindles, individually fitted beneath the curved hoop.
for (const x of [13, 16, 19, 22, 25, 28, 31, 34, 37]) {
const top = Math.floor(archZ(x) - 2);
const bottom = 25;
for (let z = bottom; z <= top; z++) {
const lean = (x - 24.5) * (z - bottom) / 100;
const sx = Math.round(x + lean);
const sy = Math.round(backY(z) - 1);
const c = z % 7 === 0 ? oak.honey :
z % 7 === 1 ? oak.dark : oak.mid;
set(sx, sy, z, c);
set(sx, sy - 1, z, z % 6 === 0 ? "#f0ba72" : "#dfa158");
if (z === 28 || z === top - 2) {
set(sx + 1, sy, z, oak.honey);
}
}
set(x, 33, 25, oak.dark);
set(x, 32, 26, oak.light);
}import { draw } from "./assets/voxel";
import { sillaWindsor } from "./assets/silla-windsor";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, sillaWindsor, 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 silla-windsor
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["silla-windsor"] })
# Queda en client/assets/silla-windsor.ts
# https://fogon.page/object/silla-windsor