← Asian3D assetfogon/kotatsu
Kotatsu
Drag to turn it// «Kotatsu» · gpt-6-sol (medium)
// A Japanese kotatsu table: a low square wooden table top over a thick quilted blanket in a warm red and orange pattern spilling to the floor on all four sides, with a bowl of mandarins on top.
// Low quilted kotatsu, centered on the floor.
const red = "#aa3028";
const orange = "#d96a2d";
const gold = "#e6b55d";
// A little shadow and the sturdy frame hidden beneath the quilt.
box(9, 9, 3, 38, 38, 12, "#482723");
for (const x of [8, 37]) for (const y of [8, 37]) {
box(x, y, 0, x + 3, y + 3, 13, "#69221e");
box(x, y, 0, x + 3, y + 3, 1, "#b4432b");
}
// Thick padded center and four generous hanging sides.
box(7, 7, 6, 40, 40, 12, "#ad3629");
function quiltColor(u, z, outer) {
const panel = Math.floor((u - 5) / 9);
const isOrange = panel % 2 === 1;
const seam = (u - 5) % 9 === 0;
const stitch = ((u + 2 * z) % 11 === 0) ||
((u - 2 * z + 110) % 11 === 0);
if (seam) return "#812826";
if (stitch && outer) return isOrange ? "#f4b668" : "#dc8060";
if (z >= 10) return isOrange ? "#e4863c" : "#c84932";
if (z <= 2) return isOrange ? "#ad4628" : "#832b28";
return isOrange
? (rand() < 0.10 ? "#ee9045" : orange)
: (rand() < 0.10 ? "#bd4030" : red);
}
for (let u = 5; u <= 42; u++) {
const hem = (u % 9 === 0 || u % 9 === 8) ? 2 : 1;
for (let z = hem; z <= 12; z++) {
for (let d = 0; d < 5; d++) {
set(u, 4 + d, z, quiltColor(u, z, d === 0));
set(u, 43 - d, z, quiltColor(u, z, d === 0));
set(4 + d, u, z, quiltColor(u, z, d === 0));
set(43 - d, u, z, quiltColor(u, z, d === 0));
}
}
// A softly uneven, gold-bound lower edge.
if (hem === 1) {
for (const p of [[u, 4], [u, 43], [4, u], [43, u]]) {
set(p[0], p[1], 0, u % 3 === 0 ? "#e3a650" : "#8d3025");
}
}
}
// Embroidered borders and little flower medallions on the visible drapes.
for (let u = 6; u <= 41; u++) {
for (const z of [3, 10]) {
set(u, 4, z, u % 9 === 0 ? gold : "#e79a57");
set(4, u, z, u % 9 === 0 ? gold : "#e79a57");
set(u, 43, z, "#b96c3d");
set(43, u, z, "#b96c3d");
}
}
for (const u of [9, 18, 27, 36]) {
for (const [a, b] of [[u, 4], [4, u], [u, 43], [43, u]]) {
set(a, b, 6, gold);
set(a, b, 8, gold);
if (a === u) {
set(a - 1, b, 7, gold);
set(a + 1, b, 7, gold);
} else {
set(a, b - 1, 7, gold);
set(a, b + 1, 7, gold);
}
set(a, b, 7, "#fff0ae");
}
}
// Red lacquer tabletop: a substantial projecting lip and a gold inset frame.
box(3, 3, 13, 44, 44, 13, "#52221e");
box(3, 3, 14, 44, 44, 15, "#a32c23");
box(3, 3, 16, 44, 44, 16, "#db8f40");
box(5, 5, 16, 42, 42, 16, "#75251f");
box(7, 7, 17, 40, 40, 17, "#822a22");
for (let i = 6; i <= 41; i++) {
set(i, 6, 17, gold);
set(i, 41, 17, "#b67a39");
set(6, i, 17, gold);
set(41, i, 17, "#b67a39");
}
for (let y = 10; y <= 38; y += 7) {
for (let x = 9; x <= 38; x++) {
if (rand() < 0.48) set(x, y, 17, "#913527");
}
}
for (let i = 4; i <= 43; i++) {
set(i, 3, 15, "#e5a64f");
set(3, i, 15, "#e5a64f");
}
// Shallow jade-glazed serving bowl.
ellipsoid(24, 23, 19, 5, 4, 2, "#245c4b");
ellipsoid(24, 23, 20, 4, 3, 1, "#438e72");
for (let x = 19; x <= 29; x++) for (let y = 18; y <= 28; y++) {
const d = Math.sqrt(((x - 24) / 5) ** 2 + ((y - 23) / 4) ** 2);
if (d > 0.76 && d <= 1.08) set(x, y, 21, "#77b798");
else if (d < 0.76) set(x, y, 20, "#244f42");
}
box(22, 21, 18, 26, 25, 18, "#163d37");
// A heap of mandarins, with tiny stems and leaves.
const fruit = [
[22, 21, 21], [25, 21, 21], [27, 23, 21],
[22, 25, 21], [25, 25, 21], [24, 23, 23]
];
for (const [x, y, z] of fruit) {
sphere(x, y, z, 2, "#e57a20");
set(x - 1, y - 1, z + 1, "#ffa63b");
set(x, y, z + 2, "#a64d19");
set(x + 1, y, z + 2, "#447742");
}import { draw } from "./assets/voxel";
import { kotatsu } from "./assets/kotatsu";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, kotatsu, 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 kotatsu
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["kotatsu"] })
# It lands in client/assets/kotatsu.ts
# https://fogon.page/object/kotatsu