← BásicoObjeto 3Dfogon/farol-v2
Farol
Arrastrá para girarlo// «Farol» · gpt-6-sol (medium)
// Lantern («Farol»). One of several variations of this object: follow the reference picture closely.
// Farol: a dark iron lantern with a warm brass floor and candle.
const iron = "#29333c";
const ironDark = "#1b252e";
const slate = "#3d4b56";
const slateLight = "#60717d";
const brass = "#b8792f";
const gold = "#e0ad53";
function rim(a, b, z, thickness, color) {
box(a, a, z, b, a + thickness - 1, z, color);
box(a, b - thickness + 1, z, b, b, z, color);
box(a, a, z, a + thickness - 1, b, z, color);
box(b - thickness + 1, a, z, b, b, z, color);
}
// Heavy, stepped foot.
box(9, 9, 0, 39, 39, 1, ironDark);
rim(9, 39, 1, 2, slate);
box(10, 10, 2, 38, 38, 3, iron);
rim(10, 38, 3, 2, slateLight);
box(11, 11, 4, 37, 37, 5, "#805b32");
box(13, 13, 5, 35, 35, 5, "#c58a3d");
rim(11, 37, 5, 2, iron);
rim(12, 36, 6, 1, brass);
// Subtle variation in the exposed golden floor.
for (let x = 14; x <= 34; x++)
for (let y = 14; y <= 34; y++)
if (rand() < 0.13) set(x, y, 5, rand() < 0.5 ? "#d49b4b" : "#ad7433");
// Four substantial corner uprights; the open sides remain readable as glass.
for (const x of [10, 37]) {
for (const y of [10, 37]) {
box(x, y, 6, x + 2, y + 2, 27, ironDark);
box(x, y, 8, x, y, 26, slateLight);
box(x + 1, y + 1, 7, x + 2, y + 2, 27, slate);
// Brass corner fittings.
box(x, y, 7, x + 2, y + 2, 8, brass);
set(x, y, 8, gold);
box(x, y, 16, x + 2, y + 2, 17, "#91652e");
set(x, y, 17, gold);
box(x, y, 26, x + 2, y + 2, 27, iron);
}
}
// Fine, pale reflections along two glass edges, without filling the opening.
line(15, 10, 9, 15, 10, 25, 0, "#91aab0");
line(37, 15, 9, 37, 15, 25, 0, "#728e98");
set(15, 10, 21, "#d4dfd7");
set(37, 15, 20, "#b8d0ca");
// A low, scalloped brass candle dish.
ellipsoid(24, 24, 7, 6, 6, 1, "#8c5a27");
ellipsoid(24, 24, 8, 5, 5, 1, gold);
ellipsoid(24, 24, 9, 4, 4, 1, brass);
for (let i = 0; i < 12; i++) {
const a = i * Math.PI / 6;
set(24 + Math.cos(a) * 5, 24 + Math.sin(a) * 5, 9,
i % 2 ? "#f0bd67" : "#a96e2b");
}
box(22, 22, 10, 26, 26, 11, "#947035");
box(23, 23, 12, 25, 25, 20, "#eee4b8");
box(23, 23, 14, 23, 25, 19, "#fff5d7");
box(23, 23, 20, 25, 25, 20, "#d8c89b");
set(24, 24, 21, "#48372a");
set(24, 24, 22, "#ffdc73");
set(24, 24, 23, "#fff1ae");
set(24, 24, 24, "#f6b64a");
// Wide overhanging iron eave.
box(5, 5, 28, 43, 43, 29, ironDark);
rim(5, 43, 28, 2, slate);
rim(5, 43, 29, 1, slateLight);
box(7, 7, 30, 41, 41, 30, slate);
rim(7, 41, 30, 1, "#72808a");
// Receding square courses form the characteristic tiered roof.
const courses = [
[9, 39, 31, "#36424c"],
[11, 37, 32, "#465560"],
[13, 35, 33, "#303d47"],
[15, 33, 34, "#46535d"],
[17, 31, 35, "#303c46"],
[19, 29, 36, "#4c5962"],
[21, 27, 37, "#303a43"]
];
for (const [a, b, z, color] of courses) {
box(a, a, z, b, b, z, color);
rim(a, b, z, 1, "#26313a");
// The left and front upper edges catch the light.
box(a + 1, a, z, b - 1, a, z, slateLight);
box(a, a + 1, z, a, b - 1, z, "#71808b");
}
box(22, 22, 38, 26, 26, 38, ironDark);
box(23, 23, 39, 25, 25, 39, brass);
// Thick upright carrying ring, with a clear opening through its center.
for (let y = 22; y <= 26; y++) {
const edge = y === 22 ? "#53616b" : y === 26 ? ironDark : iron;
box(21, y, 39, 27, y, 40, edge);
box(19, y, 41, 21, y, 43, edge);
box(27, y, 41, 29, y, 43, edge);
box(20, y, 44, 22, y, 44, edge);
box(26, y, 44, 28, y, 44, edge);
box(22, y, 45, 26, y, 45, edge);
}
box(22, 22, 40, 26, 22, 40, "#b28748");
box(23, 22, 41, 25, 22, 41, "#d0a459");import { draw } from "./assets/voxel";
import { farolV2 } from "./assets/farol-v2";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, farolV2, 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 farol-v2
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["farol-v2"] })
# Queda en client/assets/farol-v2.ts
# https://fogon.page/object/farol-v2