← NaturalezaObjeto 3Dfogon/pino
Pino
Arrastrá para girarlo// «Pino» · gpt-6-sol (medium)
// A tall classic pine tree: a straight dark brown trunk visible at the bottom, and 4 stacked cone-shaped tiers of deep blue-green needles getting smaller toward a pointed top, each tier with a lighter upper edge and a darker underside.
const cx = 24, cy = 24;
// Straight trunk with warm bark and a few chunky roots.
box(22, 22, 0, 26, 26, 17, "#805034");
box(22, 22, 0, 22, 26, 16, "#95603b");
box(26, 22, 0, 26, 26, 16, "#63402b");
box(23, 22, 0, 24, 22, 16, "#a36b40");
for (let z = 1; z < 16; z += 4) {
box(23, 22, z, 23, 22, z + 2, "#694027");
box(26, 24, z + 1, 26, 24, z + 3, "#4e3527");
}
box(20, 23, 0, 23, 25, 1, "#805034");
box(25, 23, 0, 28, 25, 1, "#70442e");
box(23, 20, 0, 25, 23, 1, "#8d5636");
box(23, 25, 0, 25, 28, 1, "#68412b");
// Four overlapping, solid cones. Their broad lower lips give each tier
// a distinct storybook silhouette.
function tier(base, top, radius) {
const height = top - base;
for (let z = base; z <= top; z++) {
const t = (z - base) / height;
const nominal = Math.max(0.55, radius * (1 - t));
for (let x = cx - radius - 2; x <= cx + radius + 2; x++) {
for (let y = cy - radius - 2; y <= cy + radius + 2; y++) {
const dx = x - cx, dy = y - cy;
const angle = Math.atan2(dy, dx);
const scallop =
0.43 * Math.sin(angle * 9 + base) +
0.25 * Math.sin(angle * 15 - base * 0.6);
const edge = nominal + scallop;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance > edge) continue;
let color;
if (z <= base + 1) {
color = "#06443f"; // shadow beneath each bough
} else if (z <= base + 3 && distance > edge - 2.5) {
color = "#07534c";
} else if (t > 0.75) {
color = "#288d76";
} else if (t > 0.51) {
color = "#207e6d";
} else {
color = "#12695f";
}
// Sunlit front and left edges; occasional broad needle highlights.
if (z > base + 2 && distance > edge - 2.3) {
if (dx < 1 && dy < 2 && rand() < 0.57) color = "#31967b";
else if (rand() < 0.11) color = "#238372";
else if (rand() < 0.12) color = "#0b5d55";
}
set(x, y, z, color);
}
}
}
}
tier(9, 22, 18);
tier(18, 31, 15);
tier(27, 39, 11);
tier(34, 45, 8);
// A clean, bright pointed crown.
set(24, 24, 45, "#38a184");import { draw } from "./assets/voxel";
import { pino } from "./assets/pino";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, pino, 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 pino
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["pino"] })
# Queda en client/assets/pino.ts
# https://fogon.page/object/pino