← Asian3D assetfogon/cerezo
Cerezo en flor
Drag to turn it// «Cerezo en flor» · gpt-6-sol (medium)
// A cherry blossom tree: dark twisted trunk and branches spreading wide, a big fluffy canopy of pink and light pink blossoms with a few white spots, fallen petals on the grass around its base.
const grass = ["#537c48", "#5d894e", "#688f54", "#719857"];
const blossom = new Set(["#c87f9d", "#d993ad", "#e9a9be"]);
for (let x = 2; x <= 45; x++) {
for (let y = 3; y <= 44; y++) {
const dx = (x - 24) / 21.5;
const dy = (y - 24) / 20.5;
if (dx * dx + dy * dy < 1 + (rand() - 0.5) * 0.09) {
set(x, y, 0, grass[Math.floor(rand() * grass.length)]);
}
}
}
// A little earth shows between the spreading roots.
ellipsoid(24, 24, 1, 6, 5, 1, "#665441");
ellipsoid(24, 24, 1, 4, 4, 1, "#594338");
const bark = "#50343b";
const barkLight = "#76505a";
const barkDark = "#3c2932";
// Gnarled, slightly leaning trunk.
line(24, 24, 1, 24, 24, 9, 4, barkDark);
line(24, 24, 6, 26, 23, 15, 3, bark);
line(26, 23, 13, 23, 24, 23, 3, bark);
line(23, 24, 21, 25, 23, 29, 2, barkDark);
line(23, 22, 5, 25, 21, 15, 1, barkLight);
line(26, 21, 14, 23, 22, 22, 1, barkLight);
line(22, 26, 3, 24, 26, 12, 1, barkLight);
// Thick exposed roots.
const roots = [
[13, 21], [17, 29], [20, 34], [31, 33],
[36, 25], [32, 17], [24, 14], [16, 17]
];
for (const [x, y] of roots) {
line(24, 24, 4, x, y, 1, 2, barkDark);
line(24, 24, 3, x, y, 1, 1, bark);
}
// Forks visible below the crown.
const boughs = [
[[24, 24, 19], [16, 24, 25], [8, 22, 29]],
[[24, 24, 20], [33, 24, 26], [40, 22, 30]],
[[25, 23, 18], [32, 17, 24], [37, 13, 29]],
[[23, 24, 18], [16, 17, 23], [11, 13, 27]],
[[24, 24, 22], [22, 31, 27], [17, 35, 31]],
[[25, 24, 21], [30, 30, 27], [37, 34, 31]],
[[23, 24, 23], [21, 19, 29], [20, 14, 35]]
];
for (const [a, b, c] of boughs) {
line(...a, ...b, 2, bark);
line(...b, ...c, 1, barkDark);
}
// Overlapping blossom clouds give the crown a scalloped outline.
const clouds = [
[24, 25, 32, 10, 8, 8],
[15, 24, 31, 8, 7, 7],
[33, 24, 32, 8, 7, 7],
[10, 22, 30, 6, 6, 6],
[39, 22, 31, 5, 6, 6],
[17, 32, 32, 7, 6, 6],
[32, 32, 33, 7, 6, 6],
[21, 15, 32, 7, 6, 7],
[30, 16, 33, 7, 6, 7],
[25, 23, 38, 7, 6, 4],
[13, 17, 35, 5, 5, 5],
[36, 17, 35, 5, 5, 5],
[11, 30, 34, 5, 5, 5],
[38, 30, 34, 5, 5, 5]
];
for (const c of clouds) ellipsoid(...c, "#c87f9d");
// Rounded tufts soften the edge and hang beneath the larger clouds.
const tufts = [
[7, 24, 30], [13, 13, 30], [18, 12, 34],
[28, 12, 35], [37, 13, 31], [42, 26, 32],
[35, 36, 34], [24, 36, 33], [10, 32, 33]
];
for (const [x, y, z] of tufts) {
ellipsoid(x, y, z, 3, 3, 4, "#d993ad");
}
// Dappled pink, with pale upper blossoms and occasional white flowers.
forEach((x, y, z, color) => {
if (!blossom.has(color)) return;
const exposed = !get(x, y, z + 1) || !get(x, y - 1, z);
const r = rand();
let shade;
if (r < 0.025 && exposed) shade = "#fff0e9";
else if (r < 0.11 && exposed) shade = "#f9d3d9";
else if (r < 0.33 + z * 0.005) shade = "#efb4c5";
else if (r < 0.72) shade = "#e49eb8";
else shade = "#ce839f";
set(x, y, z, shade);
});
// A few dark branch tips peek out from the underside.
line(23, 23, 23, 15, 17, 26, 1, barkDark);
line(26, 23, 22, 35, 17, 26, 1, barkDark);
line(24, 25, 23, 18, 32, 27, 1, barkDark);
// Grass blades and a broad scatter of fallen petals.
for (let i = 0; i < 170; i++) {
const x = 5 + Math.floor(rand() * 39);
const y = 6 + Math.floor(rand() * 37);
const d = Math.hypot(x - 24, y - 24);
if (d < 6 || d > 20 || !get(x, y, 0)) continue;
set(x, y, 1, rand() < 0.75 ? "#e9a8bb" : "#ffe0df");
if (rand() < 0.24 && get(x + 1, y, 0))
set(x + 1, y, 1, "#f3bfd0");
}
for (let i = 0; i < 85; i++) {
const x = 4 + Math.floor(rand() * 41);
const y = 5 + Math.floor(rand() * 39);
if (get(x, y, 0) && !get(x, y, 1) && rand() < 0.65)
set(x, y, 1, "#83a866");
}import { draw } from "./assets/voxel";
import { cerezo } from "./assets/cerezo";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, cerezo, 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 cerezo
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["cerezo"] })
# It lands in client/assets/cerezo.ts
# https://fogon.page/object/cerezo