← GranjaObjeto 3Dfogon/calabaza
Calabaza
Arrastrá para girarlo// «Calabaza» · gpt-6-sol (medium)
// A big round orange pumpkin, squat and wider than tall, with deep vertical ribs (alternating light and darker orange segments), a short curved brown-green stem on top, and a curly green vine with one leaf trailing down the side.
// Squat pumpkin with twelve deeply scalloped ribs.
const cx = 24, cy = 24;
const ribs = 12;
const twoPi = Math.PI * 2;
for (let z = 0; z <= 30; z++) {
const height = Math.abs((z - 14.5) / 16.5);
const profile = Math.sqrt(Math.max(0, 1 - Math.pow(height, 3.1)));
for (let y = 5; y <= 43; y++) {
for (let x = 3; x <= 45; x++) {
const dx = x - cx, dy = y - cy;
const angle = Math.atan2(dy, dx);
const rib = Math.cos(ribs * angle);
const radius = profile * (0.94 + 0.06 * rib);
const distance = Math.hypot(dx / 19.5, dy / 18.5);
if (distance > radius) continue;
const segment = Math.floor((angle + Math.PI / ribs) / (twoPi / ribs));
const lightRib = ((segment % 2) + 2) % 2 === 0;
const surface = distance > radius - 0.105;
let color = lightRib ? "#f58117" : "#e96b10";
if (z >= 20) color = lightRib ? "#ff9424" : "#f47b17";
if (z <= 6) color = lightRib ? "#df6810" : "#ca590b";
if (surface && rib < -0.65)
color = z > 18 ? "#d45c0d" : "#b94c09";
else if (surface && rib > 0.65 && z > 10)
color = lightRib ? "#ffa12e" : "#f98a1d";
if (surface && rand() < 0.025)
color = z > 15 ? "#ffad39" : "#db640e";
set(x, y, z, color);
}
}
}
// Dark green-brown calyx nestled into the crown.
ellipsoid(24, 24, 30, 4, 3, 1, "#62552a");
ellipsoid(24, 24, 31, 3, 2, 1, "#748039");
line(24, 24, 30, 25, 24, 34, 2, "#76552b");
line(25, 24, 33, 27, 25, 36, 2, "#687039");
line(27, 25, 36, 29, 25, 36, 1, "#59672e");
line(24, 23, 32, 26, 24, 35, 0, "#a09046");
// A trailing vine follows the front of the pumpkin before curling outward.
line(26, 22, 32, 30, 16, 28, 1, "#4b812f");
line(30, 16, 28, 34, 11, 24, 1, "#4b812f");
line(34, 11, 24, 38, 10, 19, 1, "#42802d");
line(38, 10, 19, 40, 10, 17, 0, "#46912e");
line(40, 10, 17, 42, 10, 18, 0, "#46912e");
line(42, 10, 18, 42, 10, 20, 0, "#46912e");
line(42, 10, 20, 40, 10, 21, 0, "#46912e");
line(40, 10, 21, 40, 10, 19, 0, "#46912e");
line(29, 16, 29, 34, 11, 25, 0, "#83b64a");
// One broad, pointed leaf hanging from the vine.
line(37, 10, 21, 36, 9, 17, 0, "#3c742c");
for (let x = 33; x <= 40; x++) {
for (let z = 13; z <= 19; z++) {
const along = (x - 36.5) / 4;
const across = (z - (16 + 0.35 * (x - 36.5))) / 2.6;
if (Math.abs(along) + 0.6 * across * across <= 1) {
set(x, 9, z, "#3c842f");
if (Math.abs(across) < 0.7 && x < 39)
set(x, 8, z, "#66ae3c");
}
}
}
line(34, 8, 15, 39, 8, 18, 0, "#a0ce58");import { draw } from "./assets/voxel";
import { calabaza } from "./assets/calabaza";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, calabaza, 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 calabaza
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["calabaza"] })
# Queda en client/assets/calabaza.ts
# https://fogon.page/object/calabaza