← Nature3D assetfogon/cristales-en-roca
Roca con cristales
Drag to turn it// «Roca con cristales» · gpt-6-sol (medium)
// A grey rock with a cluster of pointed glowing cyan crystals growing out of its top and side, crystals in 3 shades of cyan.
// Rounded stone base.
cylinder(24, 24, 0, 13, 4, "#888f91");
ellipsoid(24, 24, 9, 17, 14, 11, "#949b9d");
ellipsoid(19, 26, 8, 10, 12, 9, "#949b9d");
ellipsoid(31, 24, 7, 9, 11, 8, "#949b9d");
// Sunlit stone, shadowed edges, small flecks, and patches of moss.
forEach((x, y, z, color) => {
if (color !== "#888f91" && color !== "#949b9d") return;
const exposedTop = !get(x, y, z + 1);
const exposedFront = !get(x, y - 1, z);
let shade = z < 4 ? "#737d80" : z > 13 ? "#b5babc" : "#969fa1";
if (exposedTop) shade = "#c3c7c5";
else if (exposedFront && rand() < 0.18) shade = "#abb2b3";
if (rand() < 0.045) shade = "#d0d0ca";
const mossPatch =
(x < 19 && y > 27 && z > 7) ||
(x > 30 && y > 29 && z > 5) ||
(x < 16 && y < 22 && z < 10);
if ((exposedTop || exposedFront) && mossPatch && rand() < 0.7) {
shade = rand() < 0.35 ? "#66a866" : rand() < 0.5 ? "#88bb72" : "#a8cb82";
}
set(x, y, z, shade);
});
// All crystals share one gently pulsing, glowing part.
part("crystals", [24, 24, 18]);
function crystal(cx, cy, base, height, radius, leanX, leanY) {
for (let k = 0; k <= height; k++) {
const t = k / height;
const taper = t < 0.67
? 0.78 + 0.22 * (t / 0.67)
: Math.max(0.12, (1 - t) / 0.33);
const r = radius * taper;
const px = cx + leanX * t;
const py = cy + leanY * t;
for (let x = Math.floor(px - r - 1); x <= Math.ceil(px + r + 1); x++) {
for (let y = Math.floor(py - r - 1); y <= Math.ceil(py + r + 1); y++) {
const dx = x - px, dy = y - py;
// An eight-sided, faceted cross-section.
if (Math.max(Math.abs(dx), Math.abs(dy)) +
0.38 * Math.min(Math.abs(dx), Math.abs(dy)) > r) continue;
let color = "#23cddc";
if (dy < -0.5) color = "#73f2ee";
if (dx > 0.5 && dy >= -0.5) color = "#139eaf";
if (k < 3) color = "#159bab";
if (k > height - 3) color = "#a5fff5";
set(x, y, base + k, color);
}
}
}
}
// Tall central points, shorter rear points, and outgrowths on both sides.
crystal(23, 20, 17, 25, 5, -2, -1);
crystal(16, 23, 16, 20, 4, -3, -2);
crystal(31, 22, 16, 22, 4, 3, -1);
crystal(25, 29, 18, 17, 3, 1, 3);
crystal(20, 29, 18, 13, 3, -2, 2);
crystal(37, 22, 10, 19, 3, 5, -2);
crystal(12, 19, 10, 17, 3, -4, -2);
crystal(34, 29, 12, 11, 2, 3, 2);
animate("crystals", {
type: "colors",
palette: ["#139eaf", "#23cddc", "#73f2ee", "#e2fffb"],
pattern: "pulse",
glow: 0.6
});import { draw } from "./assets/voxel";
import { cristalesEnRoca } from "./assets/cristales-en-roca";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, cristalesEnRoca, 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 cristales-en-roca
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["cristales-en-roca"] })
# It lands in client/assets/cristales-en-roca.ts
# https://fogon.page/object/cristales-en-roca