← Nature3D assetfogon/arbusto-redondo
Arbusto redondo
Drag to turn it// «Arbusto redondo» · gpt-6-sol (medium)
// A round bush: a lumpy dome of bright green leaves made of 3 overlapping spheres in 3 shades, lighter on top, sitting directly on the ground. Low and wide.
// Three overlapping, ground-hugging lobes make one wide, leafy dome.
function lobe(cx, cy, cz, r, dark, mid, light) {
for (let x = Math.floor(cx - r); x <= Math.ceil(cx + r); x++)
for (let y = Math.floor(cy - r); y <= Math.ceil(cy + r); y++)
for (let z = 0; z <= Math.ceil(cz + r); z++) {
const d = (x - cx) ** 2 + (y - cy) ** 2 + (z - cz) ** 2;
if (d > r * r) continue;
let color = z >= 14 ? light : z >= 7 ? mid : dark;
const fleck = rand();
if (z >= 9 && fleck < 0.055) color = "#b0f36a";
else if (fleck < 0.09) color = z >= 12 ? mid : dark;
set(x, y, z, color);
}
}
// The side lobes peek out around the brighter central crown.
lobe(16, 23, 5, 13, "#368f31", "#58ba38", "#86d94c");
lobe(32, 25, 5, 13, "#3b9c32", "#65c942", "#99e45a");
lobe(24, 24, 6, 16, "#40a433", "#70d344", "#a0e95a");
// Small paired leaf highlights sit on exposed upper surfaces.
forEach((x, y, z) => {
if (z < 11 || get(x, y, z + 1) !== undefined || rand() >= 0.035) return;
set(x, y, z, "#b5f36d");
if (get(x + 1, y, z) !== undefined &&
get(x + 1, y, z + 1) === undefined &&
rand() < 0.55) {
set(x + 1, y, z, "#aaf064");
}
});import { draw } from "./assets/voxel";
import { arbustoRedondo } from "./assets/arbusto-redondo";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, arbustoRedondo, 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 arbusto-redondo
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["arbusto-redondo"] })
# It lands in client/assets/arbusto-redondo.ts
# https://fogon.page/object/arbusto-redondo