← Basics3D assetfogon/torii
Torii
Drag to turn it// «Torii» · gpt-6-sol (medium)
// Torii gate («Torii»).
// Stone paving: irregular edges, dark joints, and a little moss.
const stone = ["#87918b", "#929b95", "#9da49c", "#79847f"];
for (let tx = 0; tx < 6; tx++) {
for (let ty = 0; ty < 4; ty++) {
const x = 5 + tx * 6;
const y = 11 + ty * 7;
if ((tx === 0 && ty === 0) || (tx === 5 && ty === 3)) continue;
const edge = rand() < 0.35 ? 1 : 0;
const x1 = Math.min(x + 5 - edge, 41);
const y1 = y + 6 - (rand() < 0.25 ? 1 : 0);
box(x, y, 0, x1, y1, 1, "#515c59");
box(x, y, 2, x1, y1, 2, stone[Math.floor(rand() * stone.length)]);
if (rand() < 0.55) {
set(x + 1, y + 1, 3, "#a9afa4");
set(x + 2, y + 1, 3, "#9da69c");
}
}
}
for (let i = 0; i < 32; i++) {
const x = 5 + Math.floor(rand() * 36);
const y = 11 + Math.floor(rand() * 27);
if (get(x, y, 2) && rand() < 0.72) {
set(x, y, 3, rand() < 0.5 ? "#657951" : "#78885c");
if (rand() < 0.3) set(x + 1, y, 3, "#718055");
}
}
// Square iron-gray plinths.
for (const x of [12, 33]) {
box(x - 3, 17, 3, x + 3, 26, 4, "#343e3e");
box(x - 2, 18, 5, x + 2, 25, 6, "#58615d");
box(x - 2, 18, 6, x + 2, 24, 6, "#707972");
box(x - 2, 17, 4, x + 2, 17, 5, "#424c49");
}
// Vermilion uprights; darker fronts and sides give the posts their square form.
for (const x of [12, 33]) {
box(x - 2, 18, 7, x + 2, 23, 31, "#a63720");
box(x - 2, 18, 7, x + 1, 18, 30, "#c94a27");
box(x - 2, 19, 8, x - 2, 22, 30, "#d44e29");
box(x + 2, 19, 8, x + 2, 23, 30, "#872d1f");
box(x - 1, 19, 8, x, 19, 29, "#dc542d");
box(x - 2, 18, 7, x + 2, 23, 8, "#833226");
}
// Lower crosspiece, extending beyond the posts.
box(7, 18, 23, 39, 24, 25, "#b83921");
box(7, 17, 24, 39, 18, 26, "#d34b27");
box(7, 17, 23, 39, 17, 23, "#96321f");
box(6, 17, 24, 9, 25, 26, "#c84424");
box(37, 17, 24, 41, 25, 26, "#be3b22");
box(8, 18, 26, 39, 23, 26, "#e05a2e");
for (const x of [12, 33]) {
box(x - 3, 17, 26, x + 3, 24, 28, "#ad351e");
box(x - 2, 17, 27, x + 2, 18, 29, "#d34a27");
}
// The red lintel immediately beneath the black roof.
box(7, 19, 30, 40, 25, 32, "#a4311f");
box(7, 17, 31, 40, 19, 33, "#cd4425");
box(9, 17, 30, 38, 17, 31, "#9e3020");
box(9, 19, 32, 38, 24, 33, "#e15a2d");
box(8, 22, 29, 11, 25, 31, "#aa341e");
box(37, 22, 29, 40, 25, 31, "#a83420");
// Heavy charcoal kasagi, rising distinctly at both tips.
box(8, 16, 34, 40, 26, 35, "#303b3d");
box(9, 16, 36, 39, 25, 36, "#414b4d");
box(11, 17, 37, 37, 24, 37, "#4c5758");
box(5, 17, 35, 11, 26, 36, "#303a3c");
box(5, 17, 37, 10, 25, 38, "#404a4b");
box(39, 17, 35, 43, 26, 36, "#303a3c");
box(39, 17, 37, 44, 25, 38, "#404a4b");
box(5, 17, 38, 8, 23, 38, "#536061");
box(41, 17, 38, 44, 23, 38, "#536061");
box(8, 16, 34, 40, 16, 34, "#242e30");
box(10, 16, 35, 38, 16, 35, "#526060");
box(12, 17, 37, 36, 17, 37, "#596465");
// Stepped end caps and the thin shadow beneath the roof.
box(4, 16, 36, 6, 22, 37, "#293334");
box(43, 16, 36, 45, 22, 37, "#293334");
box(6, 19, 33, 42, 25, 33, "#242c2d");
// Small hanging gold plaque, facing the viewer.
box(21, 15, 26, 27, 18, 32, "#573d26");
box(21, 14, 27, 27, 15, 32, "#c69b43");
box(22, 13, 27, 26, 14, 31, "#e4bc60");
box(23, 12, 27, 25, 13, 30, "#343b32");
box(22, 12, 31, 26, 13, 31, "#f1d277");
box(22, 12, 27, 22, 13, 30, "#e5bb61");
box(26, 12, 27, 26, 13, 30, "#aa7c32");
set(24, 11, 30, "#b99b58");
set(24, 11, 28, "#b99b58");import { draw } from "./assets/voxel";
import { torii } from "./assets/torii";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, torii, 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 torii
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["torii"] })
# It lands in client/assets/torii.ts
# https://fogon.page/object/torii