← AsiáticoObjeto 3Dfogon/casa-japonesa
Casa tradicional japonesa
Arrastrá para girarlo// «Casa tradicional japonesa» · gpt-6-sol (medium)
// A traditional Japanese house (minka): dark wooden posts and beams, white shoji paper walls, a wide wooden veranda (engawa) along the front, a heavy dark tiled roof with deep eaves, and a small stone path and a potted pine by the door.
const wood = "#402820";
const woodLight = "#68402b";
const lacquer = "#8d3429";
const gold = "#c69b58";
const paper = "#f1e8d0";
// Stone foundation and raised house floor.
box(9, 15, 0, 38, 36, 3, "#777b75");
box(10, 16, 3, 37, 35, 5, wood);
box(9, 15, 4, 38, 36, 6, woodLight);
for (let x = 10; x <= 37; x += 4) {
box(x, 15, 3, x + 1, 36, 3, "#8d8f83");
}
// Wide engawa: individual planks run from front to back.
box(6, 8, 4, 41, 17, 4, wood);
for (let x = 7; x <= 40; x += 2) {
box(x, 8, 5, x + 1, 17, 5, x % 4 ? "#a06b42" : "#b27c4b");
}
box(6, 8, 5, 41, 8, 6, woodLight);
box(6, 17, 5, 41, 17, 6, wood);
for (const x of [8, 18, 30, 40]) {
box(x - 1, 8, 0, x + 1, 10, 2, "#8c8c82");
box(x, 9, 3, x + 1, 10, 24, wood);
box(x, 9, 20, x + 1, 10, 22, lacquer);
box(x, 9, 23, x + 1, 10, 24, gold);
}
box(7, 9, 23, 41, 10, 25, wood);
box(8, 9, 24, 40, 9, 24, lacquer);
// Solid warm-white walls, enclosed by heavy timber framing.
box(9, 16, 7, 38, 35, 25, "#e5dac1");
box(10, 14, 8, 37, 15, 23, paper);
box(9, 15, 7, 38, 16, 8, wood);
box(9, 15, 23, 38, 16, 25, wood);
box(9, 34, 23, 38, 35, 25, wood);
for (const x of [9, 21, 29, 38]) {
box(x, 14, 7, x + 1, 16, 25, wood);
box(x, 14, 19, x + 1, 15, 20, lacquer);
}
box(9, 14, 17, 38, 15, 18, woodLight);
box(9, 14, 8, 38, 14, 9, wood);
// Shoji panels on either side of the entrance.
for (const [a, b] of [[11, 20], [31, 37]]) {
box(a, 13, 10, b, 13, 22, "#f7efd9");
for (let x = a; x <= b; x += 3) box(x, 12, 10, x, 13, 22, woodLight);
for (let z = 10; z <= 22; z += 4) box(a, 12, z, b, 13, z, woodLight);
box(a, 12, 10, b, 12, 10, wood);
box(a, 12, 22, b, 12, 22, wood);
}
// Recessed doorway and one partly slid-open door.
box(23, 13, 8, 28, 15, 22, "#271e1b");
box(22, 12, 8, 23, 14, 23, wood);
box(28, 12, 8, 29, 14, 23, wood);
box(24, 12, 9, 25, 12, 21, "#eee3c9");
for (let z = 10; z <= 21; z += 4) box(24, 11, z, 25, 11, z, woodLight);
box(24, 11, 9, 24, 11, 21, woodLight);
set(27, 12, 14, gold);
box(22, 11, 7, 29, 14, 8, woodLight);
box(21, 12, 22, 30, 15, 24, lacquer);
box(22, 11, 23, 29, 11, 23, gold);
// Timber framing and small lattice windows on the visible side.
for (const y of [17, 27, 35]) box(8, y, 7, 10, y + 1, 25, wood);
box(8, 18, 10, 8, 26, 21, "#f0e5cd");
box(8, 29, 10, 8, 34, 21, "#f0e5cd");
for (const y of [18, 21, 24, 27, 30, 33]) box(7, y, 10, 8, y, 21, woodLight);
for (const z of [10, 14, 18, 21]) box(7, 18, z, 8, 34, z, woodLight);
box(8, 16, 23, 9, 35, 25, wood);
box(38, 16, 23, 39, 35, 25, wood);
// Heavy, slightly upturned glazed-tile roof.
function roofHeight(y, x) {
const d = Math.abs(y - 24);
return 36 - Math.floor(d * 0.72)
+ Math.max(0, d - 13)
+ ((x <= 4 || x >= 43) ? 1 : 0);
}
for (let y = 8; y <= 40; y++) {
for (let x = 3; x <= 44; x++) {
const h = roofHeight(y, x);
box(x, y, h - 2, x, y, h - 1, "#25332f");
const shade = (x + y * 3) % 11 === 0 ? "#4d695c"
: (y % 4 === 0 ? "#3d594e" : "#31483f");
set(x, y, h, shade);
if (x % 3 === 0 && y > 8 && y < 40) {
set(x, y, h + 1, y % 4 === 0 ? "#638071" : "#4b685a");
}
}
}
for (let x = 4; x <= 43; x++) {
set(x, 8, roofHeight(8, x) - 1, "#a47542");
set(x, 40, roofHeight(40, x) - 1, "#a47542");
}
box(4, 23, 37, 43, 25, 38, "#263b35");
box(5, 24, 39, 42, 24, 39, "#577163");
for (const x of [4, 43]) {
box(x, 23, 38, x, 25, 40, "#4f6355");
set(x, 24, 41, gold);
}
// Stepped stone approach rising to the veranda.
for (let y = 0; y <= 7; y += 2) {
const x = 25 + (y % 4 === 0 ? 0 : 1);
box(x - 2, y, 0, x + 2, y + 1, 0, "#aaa99c");
box(x - 1, y, 1, x + 1, y + 1, 1, "#d3cfb9");
}
box(23, 6, 1, 29, 8, 2, "#85877e");
box(23, 7, 3, 29, 9, 4, "#aaa99c");
box(23, 8, 5, 29, 9, 5, "#c5bda6");
// Glazed pot and sculptural pine beside the entrance.
box(3, 3, 0, 9, 8, 1, "#6c7773");
box(4, 4, 1, 8, 7, 3, "#466d66");
box(3, 3, 4, 9, 8, 4, "#789487");
box(4, 4, 5, 8, 7, 5, "#51483a");
line(6, 5, 5, 7, 5, 14, 1, wood);
line(7, 5, 10, 3, 4, 12, 1, wood);
line(7, 5, 12, 11, 6, 15, 1, wood);
line(7, 5, 14, 6, 4, 19, 1, wood);
ellipsoid(3, 4, 13, 3, 2, 2, "#294b35");
ellipsoid(10, 6, 15, 3, 2, 2, "#315d3b");
ellipsoid(6, 4, 19, 4, 3, 2, "#345c3d");
for (const [x, y, z] of [[2, 3, 14], [9, 5, 16], [5, 3, 20]]) {
ellipsoid(x, y, z, 2, 1, 1, "#4c794a");
}import { draw } from "./assets/voxel";
import { casaJaponesa } from "./assets/casa-japonesa";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, casaJaponesa, 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 casa-japonesa
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["casa-japonesa"] })
# Queda en client/assets/casa-japonesa.ts
# https://fogon.page/object/casa-japonesa