← Nature3D assetfogon/girasol
Girasol
Drag to turn it// «Girasol» · gpt-6-sol (medium)
// A tall sunflower: a green stem with two broad leaves and a big round flower head facing the front (-y), bright yellow petals around a dark brown seed center.
// Tall sunflower in a cheerful, chunky storybook style.
const stemDark = "#247c38";
const stemGreen = "#329b43";
const stemLight = "#56bd52";
// Sturdy stem, rooted at floor level.
cylinder(24, 25, 0, 2, 30, stemGreen);
for (let z = 1; z < 29; z++) {
set(23, 23, z, z % 6 === 0 ? "#70cd60" : stemLight);
if (z % 5 === 2) set(26, 25, z, stemDark);
}
ellipsoid(24, 25, 2, 3, 3, 2, stemDark);
// Broad, pointed leaves with gently arched centers.
function leaf(rootX, rootZ, direction, tipZ, centerY) {
for (let i = 0; i <= 16; i++) {
const t = i / 16;
const x = rootX + direction * i;
const midZ = rootZ + (tipZ - rootZ) * t + 2.8 * Math.sin(Math.PI * t);
const halfWidth = 4.0 * Math.pow(Math.sin(Math.PI * t), 0.8);
const halfDepth = 1.5 + 0.8 * Math.sin(Math.PI * t);
for (let z = Math.ceil(midZ - halfWidth); z <= Math.floor(midZ + halfWidth); z++) {
for (let y = Math.ceil(centerY - halfDepth); y <= Math.floor(centerY + halfDepth); y++) {
const cross = halfWidth > 0 ? (z - midZ) / halfWidth : 0;
const depth = (y - centerY) / halfDepth;
if (cross * cross + depth * depth > 1.05) continue;
const color = z > midZ + 0.5 ? "#70cc54"
: y < centerY ? "#4db849" : "#2e963e";
set(x, y, z, color);
}
}
}
// A pale vein on the viewer-facing surface.
for (let i = 1; i < 15; i++) {
const t = i / 16;
const z = rootZ + (tipZ - rootZ) * t + 2.8 * Math.sin(Math.PI * t);
set(rootX + direction * i, centerY - 2, z, "#a1dd6c");
}
}
leaf(23, 15, -1, 20, 24);
leaf(25, 13, 1, 19, 25);
line(23, 25, 15, 20, 24, 17, 1, stemDark);
line(25, 25, 13, 28, 25, 15, 1, stemDark);
// The whole flower nods gently at its attachment to the stem.
part("flowerHead", [24, 25, 29]);
ellipsoid(24, 25, 30, 8, 2, 8, "#318c3e");
// A staggered layer of golden petals adds depth behind the main ring.
function petals(count, offset, outer, back) {
for (let p = 0; p < count; p++) {
const angle = 2 * Math.PI * (p + offset) / count;
const c = Math.cos(angle), s = Math.sin(angle);
for (let x = 7; x <= 41; x++) {
for (let z = 13; z <= 46; z++) {
const dx = x - 24, dz = z - 30;
const along = dx * c + dz * s;
const across = -dx * s + dz * c;
if (along < 7.1 || along > outer) continue;
const taper = Math.sin(Math.PI * (along - 7.1) / (outer - 7.1));
const width = (back ? 2.6 : 3.2) * Math.pow(Math.max(0, taper), 0.65);
if (Math.abs(across) > width) continue;
for (let y = back ? 24 : 21; y <= (back ? 26 : 24); y++) {
const color = back ? (y === 26 ? "#d79025" : "#f4b833")
: y === 24 ? "#e5a02a"
: along > outer - 2 ? "#ffe166"
: Math.abs(across) < 1.1 ? "#ffdb40" : "#ffc737";
set(x, y, z, color);
}
}
}
}
}
petals(14, 0.5, 13.8, true);
petals(14, 0, 15.4, false);
// Warm golden rim around a thick, dark seed center.
ellipsoid(24, 21, 30, 9, 3, 9, "#e99b2d");
ellipsoid(24, 20, 30, 8, 3, 8, "#713b20");
for (let x = 16; x <= 32; x++) {
for (let z = 22; z <= 38; z++) {
const dx = x - 24, dz = z - 30;
const r2 = dx * dx + dz * dz;
if (r2 > 59) continue;
const y = r2 < 29 ? 16 : r2 < 49 ? 17 : 18;
set(x, y, z, z > 32 ? "#88502a" : "#63331d");
// Readable, orderly seed flecks with a little natural variation.
if ((x + 2 * z) % 4 === 0 && r2 < 52 && rand() > 0.12) {
set(x, y - 1, z, rand() > 0.35 ? "#b77532" : "#a65e29");
}
}
}
animate("flowerHead", { type: "swing", axis: "y", speed: 1, amplitude: 0.15 });import { draw } from "./assets/voxel";
import { girasol } from "./assets/girasol";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, girasol, 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 girasol
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["girasol"] })
# It lands in client/assets/girasol.ts
# https://fogon.page/object/girasol