← BásicoObjeto 3Dfogon/silla-windsor-v3
Silla Windsor
Arrastrá para girarlo// «Silla Windsor» · gpt-6-sol (medium)
// Windsor chair («Silla Windsor»). One of several variations of this object: follow the reference picture closely.
// Windsor chair — pale honey wood, arched spindle back.
const wood = "#b9925e";
const woodLight = "#d2ad73";
const woodDark = "#89683f";
const seatLight = "#f5d19a";
function shadedWood(x, y, z) {
const n = rand();
return n < 0.07 ? woodDark : n < 0.27 ? woodLight : wood;
}
// Four slender, splayed legs.
for (const [topX, topY, footX, footY] of [
[12, 14, 8, 8], [36, 14, 41, 8],
[12, 32, 8, 39], [36, 32, 41, 39]
]) {
for (let z = 0; z <= 20; z++) {
const t = z / 20;
const x = Math.round(footX + (topX - footX) * t);
const y = Math.round(footY + (topY - footY) * t);
box(x, y, z, x + 1, y + 1, z, shadedWood(x, y, z));
}
box(footX, footY, 0, footX + 1, footY + 1, 2, woodDark);
}
// Low stretchers, set well below the seat.
line(10, 16, 8, 10, 35, 8, 0, wood);
line(39, 16, 8, 39, 35, 8, 0, wood);
line(10, 17, 10, 39, 17, 10, 0, woodLight);
line(10, 34, 10, 39, 34, 10, 0, wood);
for (const x of [10, 39]) {
for (const y of [17, 34]) box(x, y, 8, x + 1, y + 1, 9, woodDark);
}
// Shallow apron beneath the seat.
for (let x = 11; x <= 38; x++) {
box(x, 12, 18, x, 13, 20, x % 6 === 0 ? woodDark : wood);
box(x, 32, 18, x, 33, 20, woodDark);
}
for (let y = 15; y <= 31; y++) {
box(10, y, 18, 11, y, 20, wood);
box(38, y, 18, 39, y, 20, wood);
}
// Rounded, solid saddle seat. Its front edge bows gently forward.
function inSeat(x, y) {
if (x < 8 || x > 40 || y < 10 || y > 35) return false;
const dx = Math.abs(x - 24);
const front = 10 + Math.max(0, Math.round((dx - 9) * 0.55));
const rear = 35 - Math.max(0, Math.round((dx - 12) * 0.32));
return y >= front && y <= rear;
}
for (let x = 8; x <= 40; x++) {
for (let y = 10; y <= 35; y++) {
if (!inSeat(x, y)) continue;
const edge = !inSeat(x - 1, y) || !inSeat(x + 1, y) ||
!inSeat(x, y - 1) || !inSeat(x, y + 1);
set(x, y, 20, edge ? woodDark : wood);
set(x, y, 21, edge ? wood : woodLight);
set(x, y, 22, edge ? "#c59d65" :
rand() < 0.12 ? "#edc68e" : seatLight);
}
}
// Quiet, lengthwise wood grain across the broad pale seat.
for (const x of [15, 19, 25, 30, 35]) {
for (let y = 15; y <= 31; y++) {
if (inSeat(x, y) && rand() < 0.78)
set(x, y, 22, rand() < 0.5 ? "#edc58c" : "#f8d7a3");
}
}
// Back rail and nine individual, narrow turned spindles.
for (let x = 11; x <= 37; x++) {
box(x, 34, 23, x, 35, 24, x % 4 === 0 ? woodLight : wood);
}
function bowHeight(x) {
return Math.round(43 - 0.065 * (x - 24) * (x - 24));
}
for (const x of [12, 15, 18, 21, 24, 27, 30, 33, 36]) {
const top = bowHeight(x) - 2;
for (let z = 25; z <= top; z++) {
const y = z > 35 ? 36 : 35;
set(x, y, z, z % 8 === 0 ? woodLight : wood);
if (z >= 27 && z <= 30) set(x, y + 1, z, woodDark);
}
box(x, 34, 25, x, 35, 26, woodLight);
}
// Thick continuous bow, with its crown gently flattened.
for (let x = 8; x <= 40; x++) {
const z = bowHeight(x);
const y = 36 + (Math.abs(x - 24) > 12 ? 1 : 0);
box(x, y, z, x, y + 1, z + 1, wood);
set(x, y, z + 2, woodLight);
if (x % 5 === 0) set(x, y + 1, z, woodDark);
}
box(20, 36, 43, 28, 37, 44, woodLight);
// The bow turns down at both sides and flows into short curved arms.
for (const side of [-1, 1]) {
const outerX = side < 0 ? 8 : 40;
for (let z = 25; z <= bowHeight(outerX); z++)
box(outerX, 36, z, outerX + 1, 37, z, wood);
for (let y = 21; y <= 36; y++) {
const x = outerX + (side < 0 ? Math.round((36 - y) * 0.13)
: -Math.round((36 - y) * 0.13));
const z = 25 + (y > 29 ? 1 : 0);
box(x, y, z, x + 1, y, z + 1, wood);
set(x, y, z + 2, woodLight);
}
const endX = side < 0 ? 10 : 38;
box(endX, 19, 24, endX + 1, 22, 26, woodLight);
}import { draw } from "./assets/voxel";
import { sillaWindsorV3 } from "./assets/silla-windsor-v3";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, sillaWindsorV3, 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-v3
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["silla-windsor-v3"] })
# Queda en client/assets/silla-windsor-v3.ts
# https://fogon.page/object/silla-windsor-v3