← Basics3D assetfogon/aplique-de-pared
Aplique de pared
Drag to turn it// «Aplique de pared» · gpt-6-sol (medium)
// Wall sconce («Aplique de pared»).
// Pale stone wall and its projecting ledge.
box(9, 32, 2, 40, 35, 42, "#b8ae9a");
box(12, 30, 3, 39, 31, 41, "#c6bcaa");
box(8, 28, 2, 13, 35, 42, "#b0a590");
for (let z = 5; z <= 41; z += 6) {
box(8, 27, z, 13, 29, z, "#d5cbb6");
box(9, 28, z - 1, 12, 29, z - 1, "#958b79");
}
for (let z = 5; z < 41; z++) {
for (let x = 14; x <= 39; x++) {
if (rand() < 0.075) set(x, 30, z, rand() < 0.5 ? "#beb4a1" : "#d0c6b3");
}
}
box(8, 28, 0, 40, 37, 1, "#a99d89");
box(7, 27, 2, 41, 36, 3, "#d0c6b3");
box(7, 28, 43, 42, 36, 44, "#d1c7b3");
box(8, 27, 42, 41, 35, 42, "#aa9f8b");
line(8, 27, 44, 42, 27, 44, 0, "#e0d5bf");
// Dark arched backplate and the stout bracket behind the lamp.
for (let z = 17; z <= 32; z++) {
for (let x = 23; x <= 34; x++) {
const dx = (x - 28.5) / 5.8;
const dz = (z - 24) / 8.5;
if (dx * dx + dz * dz <= 1) {
set(x, 29, z, "#26352e");
if (dx * dx + dz * dz > 0.68) set(x, 28, z, "#37483b");
}
}
}
box(26, 21, 21, 31, 30, 25, "#27352d");
box(27, 20, 24, 30, 29, 25, "#6c6545");
// An octagonal footprint gives the lantern its clipped corners.
function oct(x, y, x0, x1, y0, y1, cut) {
if (x < x0 || x > x1 || y < y0 || y > y1) return false;
return Math.min(x - x0, x1 - x) + Math.min(y - y0, y1 - y) >= cut;
}
function rim(x, y, x0, x1, y0, y1, cut) {
return oct(x, y, x0, x1, y0, y1, cut) &&
(!oct(x - 1, y, x0, x1, y0, y1, cut) ||
!oct(x + 1, y, x0, x1, y0, y1, cut) ||
!oct(x, y - 1, x0, x1, y0, y1, cut) ||
!oct(x, y + 1, x0, x1, y0, y1, cut));
}
// Solid warm glass, enclosed in deep green-bronze framing.
for (let z = 11; z <= 26; z++) {
for (let x = 18; x <= 39; x++) {
for (let y = 11; y <= 28; y++) {
if (!oct(x, y, 18, 39, 11, 28, 4)) continue;
let c = z < 13 ? "#71613c" : z > 24 ? "#34473a" : "#c9b887";
if (rim(x, y, 18, 39, 11, 28, 4))
c = z < 14 ? "#26392f" : "#34483a";
set(x, y, z, c);
}
}
}
// Front panes and their weighty upright mullions.
for (let z = 14; z <= 24; z++) {
for (let x = 22; x <= 35; x++) {
const pane = (x >= 25 && x <= 28) || (x >= 31 && x <= 34);
set(x, 10, z, pane ? (z > 20 ? "#ead9a6" : "#d9c89a") : "#314638");
}
}
for (const x of [22, 29, 35]) {
box(x, 9, 13, x + 1, 11, 25, "#334739");
line(x, 9, 15, x, 9, 23, 0, "#86784a");
}
box(26, 9, 15, 26, 9, 22, "#f0dda8");
box(32, 9, 16, 32, 9, 22, "#eedbab");
// The visible right-hand facet has its own panes.
for (let z = 14; z <= 24; z++) {
for (let y = 16; y <= 23; y++) {
set(40, y, z, (y >= 18 && y <= 21) ? "#d9c99d" : "#34483a");
}
}
box(40, 17, 15, 40, 17, 23, "#e7d5a6");
box(40, 22, 13, 40, 23, 25, "#34483a");
box(39, 15, 14, 40, 16, 24, "#756642");
// Heavy base, with a brass line just above its dark foot.
for (let z = 9; z <= 12; z++) {
for (let x = 18; x <= 39; x++) for (let y = 11; y <= 28; y++) {
if (!oct(x, y, 18, 39, 11, 28, 4)) continue;
set(x, y, z, z === 9 ? "#283b32" : z === 12 ? "#b89252" : "#665a38");
if (rim(x, y, 18, 39, 11, 28, 4) && z === 10)
set(x, y, z, "#9b793f");
}
}
// Wide stepped, clipped-corner copper roof.
const tiers = [
[26, 15, 42, 8, 31, 5],
[27, 15, 42, 8, 31, 5],
[28, 16, 41, 9, 30, 5],
[29, 18, 40, 10, 29, 4],
[30, 19, 38, 11, 28, 4],
[31, 21, 36, 13, 26, 3],
[32, 23, 34, 15, 24, 3],
[33, 25, 32, 17, 22, 2]
];
for (const [z, x0, x1, y0, y1, cut] of tiers) {
for (let x = x0; x <= x1; x++) for (let y = y0; y <= y1; y++) {
if (!oct(x, y, x0, x1, y0, y1, cut)) continue;
const edge = rim(x, y, x0, x1, y0, y1, cut);
let c = edge ? (z <= 27 ? "#344439" : "#a8753e") :
((x + 2 * y) % 5 === 0 ? "#d4a763" : "#b8884d");
if (z === 26) c = edge ? "#263a32" : "#82633c";
if (z === 27 && edge) c = "#d2a25b";
if (z >= 30 && edge) c = "#805b36";
set(x, y, z, c);
}
}
// Individual bright tile edges make the layered roof legible.
for (const [z, x0, x1, y0, y1, cut] of tiers.slice(2, 7)) {
for (let x = x0; x <= x1; x += 4) {
for (let y = y0; y <= y1; y++) {
if (oct(x, y, x0, x1, y0, y1, cut))
set(x, y, z, "#deb16f");
}
}
}
// Small dark cap and finial at the crown.
box(27, 18, 34, 30, 21, 35, "#3a4836");
box(28, 19, 36, 30, 21, 37, "#263b32");
set(29, 20, 38, "#8d7948");import { draw } from "./assets/voxel";
import { apliqueDePared } from "./assets/aplique-de-pared";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, apliqueDePared, 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 aplique-de-pared
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["aplique-de-pared"] })
# It lands in client/assets/aplique-de-pared.ts
# https://fogon.page/object/aplique-de-pared