← Antiguo y prehistoriaObjeto 3Dfogon/obelisco-egipcio
Obelisco egipcio
Arrastrá para girarlo// «Obelisco egipcio» · gpt-6-sol (medium)
// A tall slender Egyptian obelisk of pinkish-red granite on a square stepped base, with a small pointed gold pyramid tip and columns of carved hieroglyph symbols (darker red) on each face.
const sandstone = ["#c9975e", "#d9a96d", "#e6b87a"];
const granite = ["#a94f52", "#bd6565", "#cb7773", "#d78b7d"];
const carved = "#78343d";
const carvedLight = "#91444a";
const gold = ["#b88329", "#e4af3b", "#ffd05a", "#ffe18a"];
function stoneBox(x0, y0, z0, x1, y1, z1, palette) {
for (let z = z0; z <= z1; z++)
for (let y = y0; y <= y1; y++)
for (let x = x0; x <= x1; x++) {
let shade = z === z1 ? 2 : (x === x0 || y === y1 ? 0 : 1);
if (rand() < 0.12) shade = Math.floor(rand() * palette.length);
set(x, y, z, palette[shade]);
}
}
// Broad, friendly sandstone plinth with two receding steps.
stoneBox(11, 11, 0, 36, 36, 2, sandstone);
stoneBox(13, 13, 3, 34, 34, 5, sandstone);
stoneBox(16, 16, 6, 31, 31, 9, granite);
function rim(lo, hi, z, color) {
for (let p = lo; p <= hi; p++) {
set(p, lo, z, color); set(p, hi, z, color);
set(lo, p, z, color); set(hi, p, z, color);
}
}
rim(11, 36, 1, "#a97848");
rim(11, 36, 2, "#efc383");
rim(13, 34, 4, "#b88652");
rim(13, 34, 5, "#f0c684");
rim(16, 31, 7, "#8f4648");
rim(16, 31, 9, "#e5a083");
// Turquoise and lapis inlays on all four sides of the stepped base.
for (const p of [18, 23, 28]) {
for (const side of [13, 34]) {
set(p, side, 4, "#276e83");
set(p + 1, side, 4, "#58c6bb");
}
for (const side of [13, 34]) {
set(side, p, 4, "#276e83");
set(side, p + 1, 4, "#58c6bb");
}
}
// The solid granite shaft narrows in chunky, deliberate stages.
function bounds(z) {
const half = 6 - Math.min(3, Math.floor((z - 10) / 9));
return [24 - half, 23 + half];
}
for (let z = 10; z <= 39; z++) {
const [lo, hi] = bounds(z);
for (let y = lo; y <= hi; y++)
for (let x = lo; x <= hi; x++) {
let shade = 1;
if (x === lo || y === hi) shade = 0;
if (y === lo || z === 39) shade = 2;
if (rand() < 0.11) shade = Math.floor(rand() * 4);
set(x, y, z, granite[shade]);
}
}
// Each bitmap is a different large, deeply cut hieroglyph.
const glyphs = [
["0110", "1001", "1111", "0110"], // eye
["0110", "1001", "0110", "0110"], // ankh
["1001", "1110", "0111", "0100"], // bird
["1100", "0110", "0011", "0110"], // water
["0010", "1111", "0010", "0111"], // reed
["0110", "1111", "1111", "0110"] // sun
];
const heights = [12, 17, 22, 27, 32, 36];
for (let g = 0; g < glyphs.length; g++) {
for (let row = 0; row < 4; row++) {
const z = heights[g] + 3 - row;
const [lo, hi] = bounds(z);
for (let col = 0; col < 4; col++) {
if (glyphs[g][row][col] !== "1") continue;
const ink = (row === 0 && col % 2 === 0) ? carvedLight : carved;
const p = 22 + col;
set(p, lo, z, ink); // front
set(p, hi, z, ink); // back
set(lo, p, z, ink); // left
set(hi, p, z, ink); // right
}
}
}
// Gold collar and stepped pointed pyramidion.
stoneBox(20, 20, 40, 27, 27, 40, gold);
rim(20, 27, 40, "#ffe18a");
for (let z = 41; z <= 45; z++) {
const inset = z <= 42 ? 21 : z <= 44 ? 22 : 23;
const far = 47 - inset;
for (let y = inset; y <= far; y++)
for (let x = inset; x <= far; x++)
set(x, y, z, x === inset ? gold[0] : y === inset ? gold[3] : gold[2]);
}import { draw } from "./assets/voxel";
import { obeliscoEgipcio } from "./assets/obelisco-egipcio";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, obeliscoEgipcio, 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 obelisco-egipcio
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["obelisco-egipcio"] })
# Queda en client/assets/obelisco-egipcio.ts
# https://fogon.page/object/obelisco-egipcio