← FantasíaObjeto 3Dfogon/arbol-magico
Árbol mágico
Arrastrá para girarlo// «Árbol mágico» · gpt-6-sol (medium)
// A magical tree with a thick twisted trunk of dark grey-brown bark, big roots spreading on a mossy base, and a round puffy crown of teal and turquoise leaves. Glowing pink and golden fruit-like orbs hang among the leaves, a little round wooden door with a tiny window in the trunk, a few glowing mushrooms between the roots.
// Mossy stone clearing
ellipsoid(24, 24, 0, 19, 17, 2, "#50554f");
ellipsoid(24, 24, 1, 17, 15, 2, "#426851");
for (let i = 0; i < 180; i++) {
const x = 7 + Math.floor(rand() * 35);
const y = 9 + Math.floor(rand() * 31);
if (((x - 24) / 18) ** 2 + ((y - 24) / 16) ** 2 < 1) {
set(x, y, 2, rand() < 0.55 ? "#568761" : "#697d63");
}
}
for (let i = 0; i < 18; i++) {
const a = rand() * Math.PI * 2, d = 10 + rand() * 8;
ellipsoid(24 + Math.cos(a) * d, 24 + Math.sin(a) * d, 1, 1 + rand() * 2, 1 + rand() * 2, 1, "#70756c");
}
// Wide, knotted roots reaching over the clearing
for (let i = 0; i < 9; i++) {
const a = i * Math.PI * 2 / 9 + 0.16;
const dx = Math.cos(a), dy = Math.sin(a);
line(24 + dx * 2, 24 + dy * 2, 7,
24 + dx * 7, 24 + dy * 7, 3, 3, "#383330");
line(24 + dx * 6, 24 + dy * 6, 3,
24 + dx * (13 + i % 3), 24 + dy * (13 + i % 3), 1, 2, "#484039");
line(24 + dx * 9, 24 + dy * 9, 3,
24 + dx * 14, 24 + dy * 14, 1, 0, "#76614b");
for (let t = 9; t < 14; t += 2)
set(24 + dx * t, 24 + dy * t, 3, "#648365");
}
// Thick trunk with a gentle, twisted lean
for (let z = 3; z <= 29; z += 2) {
const cx = 24 + Math.sin(z * 0.25) * 1.4;
const cy = 24 + Math.cos(z * 0.22) * 0.8;
ellipsoid(cx, cy, z, z < 10 ? 6.5 : 5.4, z < 10 ? 6.1 : 5.2, 3,
z % 4 === 3 ? "#423a36" : "#4c403a");
}
ellipsoid(23, 24, 26, 7, 6, 5, "#403935");
ellipsoid(29, 25, 25, 5, 5, 5, "#494039");
// Spiral bark ridges, with warm worn edges
for (let k = 0; k < 7; k++) {
const a0 = k * Math.PI * 2 / 7;
for (let z = 7; z < 27; z++) {
const a = a0 + z * 0.14;
const cx = 24 + Math.sin(z * 0.25) * 1.4;
const cy = 24 + Math.cos(z * 0.22) * 0.8;
const x = cx + Math.cos(a) * 5.5;
const y = cy + Math.sin(a) * 5.2;
set(x, y, z, k % 2 ? "#675249" : "#302e2d");
if (z % 4 === 0) set(x, y, z + 1, "#79604d");
}
}
ellipsoid(29, 19, 15, 2, 1, 3, "#302e2d");
ellipsoid(29, 18, 15, 1, 1, 2, "#77604a");
// Small round front door, framed in weathered wood
ellipsoid(24, 17, 6, 5, 2, 6, "#282a2b");
ellipsoid(24, 15, 6, 4, 1, 5, "#a2714d");
ellipsoid(24, 14, 6, 3, 1, 4, "#704d3c");
for (const x of [22, 25]) line(x, 13, 3, x, 13, 8, 0, "#9b6b48");
line(21, 13, 3, 27, 13, 3, 0, "#49372f");
ellipsoid(24, 12, 8, 2, 1, 2, "#d7a44f");
ellipsoid(24, 11, 8, 1, 1, 1, "#8ff7e4");
set(24, 10, 8, "#e1ffdc");
set(26, 12, 5, "#ffcd64");
set(26, 11, 5, "#fff0a0");
// Puffy canopy: darker interior and overlapping rounded leaf clouds
ellipsoid(24, 24, 34, 15, 14, 10, "#165b60");
const clouds = [
[24,24,39,10,10,6], [16,23,34,8,8,7], [32,24,35,8,8,7],
[23,16,34,9,7,7], [24,32,35,9,7,7],
[13,18,32,6,6,6], [35,17,32,6,6,6],
[14,30,34,6,6,6], [34,31,34,7,6,6],
[19,14,39,6,6,5], [30,14,39,6,6,5],
[17,32,40,6,6,5], [30,31,40,7,6,5],
[23,24,44,7,7,3]
];
const leafColors = ["#218f91", "#269da0", "#2faeaa", "#258482", "#38b9ac"];
for (let i = 0; i < clouds.length; i++) {
const [x,y,z,rx,ry,rz] = clouds[i];
ellipsoid(x, y, z, rx, ry, rz, leafColors[i % leafColors.length]);
ellipsoid(x - 1, y - 1, z + rz * 0.47,
rx * 0.7, ry * 0.65, Math.max(1, rz * 0.35),
i % 2 ? "#52c6b6" : "#40b5ab");
}
// Bright little tufts break up the leaf surface
for (let i = 0; i < 190; i++) {
const c = clouds[Math.floor(rand() * clouds.length)];
const a = rand() * Math.PI * 2;
const h = rand() * 1.6 - 0.45;
const x = c[0] + Math.cos(a) * c[3] * (0.65 + rand() * 0.25);
const y = c[1] + Math.sin(a) * c[4] * (0.65 + rand() * 0.25);
const z = c[2] + h * c[5] * 0.6;
if (get(x, y, z)) set(x, y, z, rand() < 0.5 ? "#58cbbb" : "#19777d");
}
// Hanging enchanted fruit; foremost fruit sit against the dark leaves
const fruit = [
[14,12,31,0], [21,10,35,1], [29,11,32,0], [36,15,36,1],
[11,20,36,1], [18,13,40,0], [33,13,39,0], [27,15,27,1],
[15,29,37,0], [34,30,34,1]
];
for (const [x,y,z,gold] of fruit) {
line(x, y + 1, z + 3, x, y, z + 1, 0, "#775d58");
sphere(x, y, z, 2, gold ? "#e5a83f" : "#d84b9b");
set(x - 1, y - 2, z + 1, gold ? "#ffe994" : "#ff9bed");
set(x, y - 2, z, gold ? "#fff1a4" : "#ffb0f0");
}
// Glowing mushrooms nestled between the roots
const mushrooms = [
[14,16,0], [33,14,1], [10,27,1], [38,28,0],
[18,36,1], [30,37,0], [17,11,0]
];
for (const [x,y,pink] of mushrooms) {
box(x, y, 2, x, y, 4, "#e2c9af");
ellipsoid(x, y, 5, 2, 2, 1, pink ? "#dd58c0" : "#43c9b9");
set(x, y - 2, 5, pink ? "#ffb1f2" : "#a2fff0");
set(x - 1, y - 1, 6, "#f7e6bf");
set(x + 1, y, 6, "#fff1cd");
}import { draw } from "./assets/voxel";
import { arbolMagico } from "./assets/arbol-magico";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, arbolMagico, 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 arbol-magico
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["arbol-magico"] })
# Queda en client/assets/arbol-magico.ts
# https://fogon.page/object/arbol-magico