← CiudadObjeto 3Dfogon/light-mast
Torre de iluminación
Arrastrá para girarlo// «Torre de iluminación» · propio
// A tall steel lattice light mast on a concrete base with a crossbar of four floodlights at the top, the lamps bright warm yellow.
// A steel lattice light mast on a concrete base, with a crossbar of four floodlights facing the front.
const STEEL = { base: "#8a9199", light: "#a6adb4", dark: "#626970", brace: "#737a82" };
const CONCRETE = { base: "#b3b1ab", light: "#c5c3bd", dark: "#96948e" };
const HOUSING = "#30343a", HOUSING_TOP = "#474c53", RIM = "#1f2226";
const LAMP = "#ffe27a", LAMP_CORE = "#fff8d2", LAMP_LOW = "#ffcf52";
// The base: a concrete block with a chamfered top and four anchor bolts.
for (let x = 15; x <= 32; x++)
for (let y = 15; y <= 32; y++)
for (let z = 0; z <= 4; z++) {
const edge = Math.min(x - 15, 32 - x, y - 15, 32 - y);
if (z === 4 && edge < 1) continue;
set(x, y, z, z === 4 ? CONCRETE.light : z === 0 || rand() < 0.15 ? CONCRETE.dark : rand() < 0.2 ? CONCRETE.light : CONCRETE.base);
}
// The mast: four legs that come closer together as they rise, a ring every six blocks and crossed braces between rings.
const BOTTOM = 5, TOP = 34;
const inset = (z) => Math.round((3 * (z - BOTTOM)) / (TOP - BOTTOM));
for (let z = BOTTOM; z <= TOP; z++) {
const lo = 18 + inset(z), hi = 29 - inset(z);
for (const [x, y] of [[lo, lo], [hi - 1, lo], [lo, hi - 1], [hi - 1, hi - 1]])
for (let i = 0; i < 2; i++)
for (let j = 0; j < 2; j++) set(x + i, y + j, z, (i === 0 && x === lo) || (j === 0 && y === lo) ? STEEL.light : STEEL.base);
}
const rings = [5, 11, 17, 23, 29, 34];
for (let n = 0; n + 1 < rings.length; n++) {
const z0 = rings[n], z1 = rings[n + 1];
const lo0 = 18 + inset(z0), hi0 = 29 - inset(z0), lo1 = 18 + inset(z1), hi1 = 29 - inset(z1);
line(lo0 + 2, lo0, z0, hi1 - 2, lo1, z1, 0, STEEL.brace);
line(hi0 - 2, lo0, z0, lo1 + 2, lo1, z1, 0, STEEL.brace);
line(lo0 + 2, hi0, z0, hi1 - 2, hi1, z1, 0, STEEL.dark);
line(hi0 - 2, hi0, z0, lo1 + 2, hi1, z1, 0, STEEL.dark);
line(lo0, lo0 + 2, z0, lo1, hi1 - 2, z1, 0, STEEL.brace);
line(lo0, hi0 - 2, z0, lo1, lo1 + 2, z1, 0, STEEL.brace);
line(hi0, lo0 + 2, z0, hi1, hi1 - 2, z1, 0, STEEL.dark);
line(hi0, hi0 - 2, z0, hi1, lo1 + 2, z1, 0, STEEL.dark);
}
for (const z of rings) {
const lo = 18 + inset(z), hi = 29 - inset(z);
for (let a = lo; a <= hi; a++) {
set(a, lo, z, STEEL.light); set(a, hi, z, STEEL.dark); set(lo, a, z, STEEL.light); set(hi, a, z, STEEL.dark);
}
}
// Anchor bolts and the switch box at the foot.
for (const [x, y] of [[17, 17], [30, 17], [17, 30], [30, 30]]) set(x, y, 5, "#3d4046");
box(21, 15, 6, 26, 17, 12, "#4b5058");
box(22, 14, 7, 25, 14, 11, "#5d636b");
set(25, 13, 9, "#f2c230");
// The head: a small platform, the crossbar and four lamps with their hoods.
box(20, 20, 35, 27, 27, 35, STEEL.dark);
box(22, 22, 36, 25, 25, 37, STEEL.base);
box(6, 22, 36, 41, 25, 37, STEEL.dark);
box(6, 22, 37, 41, 22, 37, STEEL.base);
for (const cx of [10, 19, 28, 37]) {
box(cx - 3, 21, 38, cx + 3, 25, 45, HOUSING);
box(cx - 3, 21, 45, cx + 3, 25, 45, HOUSING_TOP);
for (let z = 39; z <= 44; z += 2) box(cx - 2, 26, z, cx + 2, 26, z, HOUSING_TOP); // cooling fins
box(cx - 3, 20, 38, cx + 3, 20, 45, RIM);
for (let x = cx - 2; x <= cx + 2; x++)
for (let z = 39; z <= 44; z++) set(x, 20, z, Math.abs(x - cx) <= 1 && z >= 40 && z <= 43 ? LAMP_CORE : z === 39 ? LAMP_LOW : LAMP);
box(cx - 3, 19, 45, cx + 3, 19, 45, RIM); // the hood
set(cx - 3, 19, 44, RIM); set(cx + 3, 19, 44, RIM);
}import { draw } from "./assets/voxel";
import { lightMast } from "./assets/light-mast";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, lightMast, 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 light-mast
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["light-mast"] })
# Queda en client/assets/light-mast.ts
# https://fogon.gg/object/light-mast