← Fiestas y NavidadObjeto 3Dfogon/regalo-grande
Regalo grande
Arrastrá para girarlo// «Regalo grande» · gpt-6-sol (medium)
// A big cube gift box wrapped in bright red paper with white polka dots, crossed by a wide shiny gold ribbon on all four sides and a big puffy gold bow on top with two loops and two tails. The lid is a slightly wider flat slab on the top quarter of the box.
const red = "#e82838";
const redLight = "#fa3d4a";
const redDark = "#b91c30";
const gold = "#f6ba29";
const goldLight = "#ffe06a";
const goldDark = "#c98518";
const cream = "#fff9e9";
// Solid gift box, with slightly different shades on its visible faces.
box(8, 8, 0, 39, 39, 28, red);
box(8, 8, 0, 39, 8, 28, redLight);
box(39, 8, 0, 39, 39, 28, redDark);
box(8, 8, 27, 39, 39, 28, redDark);
// Subtle flecks in the wrapping paper.
for (let i = 0; i < 260; i++) {
const x = 9 + Math.floor(rand() * 30);
const z = 1 + Math.floor(rand() * 26);
const y = 9 + Math.floor(rand() * 30);
if (rand() < 0.55) set(x, 8, z, rand() < 0.5 ? red : redLight);
else set(39, y, z, rand() < 0.5 ? red : redDark);
}
// Polka dots on all four sides, kept clear of the ribbon.
function dotOnFace(side, u, z, radius) {
for (let du = -2; du <= 2; du++) {
for (let dz = -2; dz <= 2; dz++) {
if (du * du + dz * dz > radius * radius) continue;
const c = dz > 0 ? cream : "#e9eee8";
if (side === 0) set(u + du, 7, z + dz, c);
if (side === 1) set(u + du, 40, z + dz, c);
if (side === 2) set(7, u + du, z + dz, c);
if (side === 3) set(40, u + du, z + dz, c);
}
}
}
for (const u of [12, 17, 31, 36]) {
for (const z of [5, 12, 19, 25]) {
for (let side = 0; side < 4; side++)
dotOnFace(side, u, z, (u + z) % 3 === 0 ? 1.8 : 1.45);
}
}
// Two wide bands wrap around the body.
box(21, 7, 0, 26, 7, 28, gold);
box(21, 40, 0, 26, 40, 28, goldDark);
box(7, 21, 0, 7, 26, 28, gold);
box(40, 21, 0, 40, 26, 28, goldDark);
box(22, 6, 1, 23, 6, 27, goldLight);
box(7, 22, 1, 7, 23, 27, goldLight);
box(40, 25, 1, 40, 26, 27, "#e9a525");
// The lid and everything attached to it pivot at its back edge.
part("lid", [24, 41, 29]);
// Chunky, slightly overhanging lid.
box(5, 5, 29, 42, 42, 29, "#a9182a");
box(5, 5, 30, 42, 42, 33, red);
box(5, 5, 34, 42, 42, 34, redLight);
box(5, 5, 30, 42, 5, 33, "#fa4350");
box(42, 5, 30, 42, 42, 33, redDark);
box(6, 6, 34, 41, 41, 34, "#f53846");
// Little dots along the lid's front and side edges.
for (const u of [10, 16, 32, 38]) {
set(u, 4, 31, cream);
set(u, 4, 32, cream);
set(43, u, 31, cream);
set(43, u, 32, cream);
}
// Crossed gold ribbon, continuing across the lid and its top.
box(20, 4, 29, 27, 5, 34, gold);
box(20, 42, 29, 27, 43, 34, goldDark);
box(4, 20, 29, 5, 27, 34, gold);
box(42, 20, 29, 43, 27, 34, goldDark);
box(21, 5, 35, 26, 42, 35, gold);
box(5, 21, 35, 42, 26, 35, gold);
box(22, 5, 36, 23, 41, 36, goldLight);
box(5, 22, 36, 41, 23, 36, goldLight);
box(20, 20, 35, 27, 27, 36, goldDark);
// Puffy bow loops, with openings visible from the front.
function bowLoop(cx) {
ellipsoid(cx, 23, 40, 8, 5, 5, goldDark);
ellipsoid(cx, 22, 40, 7, 5, 5, gold);
ellipsoid(cx, 22, 40, 4, 7, 2.1, null);
}
bowLoop(16);
bowLoop(32);
// Raised highlights trace the upper curves.
for (let x = 10; x <= 21; x++) {
const z = Math.round(40 + 4.5 * Math.sqrt(Math.max(0, 1 - ((x - 16) / 7) ** 2)));
set(x, 19, z, goldLight);
set(48 - x, 19, z, goldLight);
}
ellipsoid(13, 19, 41, 2, 1, 1, "#fff0a0");
ellipsoid(35, 19, 41, 2, 1, 1, "#fff0a0");
// Two broad tails tumble forward from beneath the knot.
line(22, 20, 39, 17, 9, 34, 2, goldDark);
line(18, 10, 34, 15, 5, 30, 2, gold);
line(26, 20, 39, 31, 9, 34, 2, goldDark);
line(30, 10, 34, 33, 5, 30, 2, gold);
line(21, 18, 39, 16, 6, 32, 1, goldLight);
line(27, 18, 39, 32, 6, 32, 1, goldLight);
set(15, 5, 29, goldDark);
set(17, 5, 29, goldDark);
set(31, 5, 29, goldDark);
set(33, 5, 29, goldDark);
// Plump central knot and its glint.
ellipsoid(24, 19, 39, 4, 4, 3, goldDark);
ellipsoid(24, 18, 40, 3, 3, 2, gold);
box(22, 15, 40, 24, 15, 41, goldLight);
set(22, 14, 41, "#fff1a5");
animate("lid", { type: "swing", axis: "x", speed: 2, amplitude: 0.3 });import { draw } from "./assets/voxel";
import { regaloGrande } from "./assets/regalo-grande";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, regaloGrande, 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 regalo-grande
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["regalo-grande"] })
# Queda en client/assets/regalo-grande.ts
# https://fogon.page/object/regalo-grande