← Basics3D assetfogon/pupitre
Pupitre
Drag to turn it// «Pupitre» · gpt-6-sol (medium)
// School desk («Pupitre»).
// School desk: painted steel frame, honey-colored wooden top, and a side backrest.
const steel = "#28545a";
const steelLight = "#386a6b";
const steelDark = "#203e43";
const wood = "#d99b54";
const woodLight = "#f2bd72";
const woodHighlight = "#ffd18a";
const woodDark = "#a96c37";
// Four legs and their broad, dark feet.
for (const x of [9, 40]) {
for (const y of [10, 36]) {
box(x - 1, y - 1, 0, x + 2, y + 2, 2, "#343b3a");
box(x, y, 2, x + 1, y + 1, 23, steel);
box(x, y, 5, x, y, 20, steelLight);
box(x + 1, y + 1, 3, x + 1, y + 1, 20, steelDark);
box(x - 1, y - 1, 8, x + 2, y + 2, 10, steelDark);
}
}
// Low cross-bracing and the sturdy apron beneath the desktop.
box(10, 10, 10, 40, 11, 11, steelLight);
box(10, 36, 10, 40, 37, 11, steel);
box(9, 11, 11, 10, 36, 12, steelLight);
box(40, 11, 11, 41, 36, 12, steelDark);
box(9, 9, 19, 41, 11, 23, steel);
box(9, 36, 19, 41, 38, 23, steelDark);
box(8, 10, 19, 10, 37, 23, steelDark);
box(40, 10, 19, 42, 37, 23, steel);
box(11, 9, 22, 39, 9, 23, steelLight);
box(11, 10, 22, 13, 36, 23, steelLight);
box(36, 10, 22, 39, 36, 23, steelDark);
// A small shelf-like support visible below the top.
box(21, 19, 16, 25, 25, 18, "#374b47");
box(29, 25, 15, 32, 29, 18, "#374b47");
// Thick wooden top, with clipped corners and a darker edge.
box(6, 8, 24, 42, 38, 27, wood);
box(7, 7, 24, 41, 39, 27, wood);
box(6, 9, 23, 42, 37, 24, woodDark);
box(7, 8, 28, 41, 38, 28, woodLight);
box(8, 9, 28, 40, 37, 28, "#f4bf75");
box(8, 8, 28, 40, 8, 28, woodHighlight);
box(7, 9, 28, 7, 37, 28, woodHighlight);
box(8, 38, 28, 40, 38, 28, "#e6a95e");
box(41, 9, 28, 41, 37, 28, "#e5a65b");
for (let x = 9; x <= 39; x += 4) {
for (let y = 10; y <= 36; y += 5) {
if (rand() < 0.55) {
box(x, y, 29, x + (rand() < 0.5 ? 1 : 2), y, 29,
rand() < 0.5 ? "#ffd08a" : "#e9ab61");
}
}
}
// Seams and a few flecks of wood grain.
for (const y of [17, 27, 34]) {
for (const x of [10, 33, 37]) {
box(x, y, 29, x + 2, y, 29, "#edb26b");
}
}
// Backrest rises behind the left end of the desk. Its boards run front-to-back.
for (const y of [14, 34]) {
box(7, y, 28, 9, y + 2, 40, steel);
box(7, y, 31, 7, y + 2, 39, steelLight);
box(6, y - 1, 33, 10, y + 3, 35, steelDark);
box(7, y - 1, 39, 10, y + 3, 41, steelDark);
box(7, y, 41, 9, y + 2, 42, "#364844");
}
// Lower and upper wooden slats, including inset darker panels.
box(6, 15, 34, 9, 35, 36, wood);
box(6, 17, 35, 6, 33, 35, woodDark);
box(6, 14, 39, 10, 36, 42, wood);
box(5, 16, 40, 5, 34, 41, "#bb7e40");
box(6, 16, 42, 9, 34, 42, woodHighlight);
box(5, 18, 40, 5, 32, 40, "#9a6233");
box(6, 17, 36, 6, 33, 36, "#efb66c");
// Open exercise book lying on the desk.
box(13, 18, 29, 28, 32, 29, "#385d6b");
box(14, 19, 30, 27, 31, 30, "#f9f4df");
box(14, 19, 31, 20, 30, 31, "#fff9e9");
box(21, 19, 31, 27, 30, 31, "#f3f5e9");
box(20, 19, 31, 21, 31, 31, "#6c9bab");
box(13, 18, 30, 13, 32, 30, "#598394");
box(28, 18, 30, 28, 32, 30, "#497488");
for (const y of [21, 24, 27]) {
box(15, y, 32, 18, y, 32, "#b8d8df");
box(23, y, 32, 26, y, 32, "#a8cdd7");
}
box(16, 29, 32, 18, 29, 32, "#dbad79");
box(24, 29, 32, 26, 29, 32, "#dfb687");
// Red apple beside the book, with a short brown stem and green leaf.
box(14, 12, 30, 19, 17, 33, "#b74632");
box(15, 11, 31, 18, 18, 33, "#c95236");
box(15, 13, 34, 18, 16, 34, "#d65b39");
box(14, 13, 31, 14, 16, 32, "#e27448");
box(17, 15, 34, 17, 15, 37, "#63492c");
box(18, 15, 36, 21, 16, 36, "#477448");
box(18, 16, 35, 20, 17, 35, "#345c3d");
// Yellow pencil, parallel to the backrest.
box(34, 13, 30, 35, 32, 30, "#d89a36");
box(34, 15, 31, 35, 29, 31, "#f5d751");
box(34, 15, 32, 34, 29, 32, "#ffe579");
box(34, 30, 31, 35, 32, 31, "#cb7470");
box(34, 33, 30, 35, 34, 30, "#a46b40");
box(34, 12, 30, 35, 13, 30, "#3b4540");import { draw } from "./assets/voxel";
import { pupitre } from "./assets/pupitre";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, pupitre, 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 pupitre
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["pupitre"] })
# It lands in client/assets/pupitre.ts
# https://fogon.page/object/pupitre