← FantasíaObjeto 3Dfogon/gnomo
Gnomo
Arrastrá para girarlo// «Gnomo» · gpt-6-sol (medium)
// A tiny chubby cartoon garden gnome facing front (-y): a tall pointy red hat, a big fluffy white beard, round pink nose, blue shirt, brown belt and pants, little black boots, and holding a small lantern in one hand.
const blue = "#327aa0";
const blueLight = "#4798b8";
const blueDark = "#235b7d";
const brown = "#765037";
const brownLight = "#916546";
const boot = "#24232b";
const bootLight = "#3d3940";
const cream = "#f7f4e8";
const beardShade = "#d6dce0";
const brass = "#c18b43";
// Chubby body and trousers.
ellipsoid(24, 23, 13, 11, 9, 6, brown);
ellipsoid(24, 23, 20, 12, 10, 9, blue);
ellipsoid(24, 15, 21, 10, 2, 7, blueLight);
ellipsoid(24, 32, 19, 9, 1, 6, blueDark);
// Belt wraps around the round belly.
for (let x = 13; x <= 35; x++) {
for (let y = 13; y <= 32; y++) {
const dx = (x - 24) / 11.5;
const dy = (y - 23) / 10;
if (dx * dx + dy * dy <= 1 && dx * dx + dy * dy >= 0.69) {
for (let z = 13; z <= 15; z++) set(x, y, z, "#493323");
}
}
}
box(21, 12, 13, 27, 13, 16, brass);
box(23, 11, 14, 25, 11, 15, "#f0c86d");
set(24, 10, 14, "#644023");
// Face, ears, and fluffy beard.
ellipsoid(24, 20, 27, 10, 9, 8, "#efa995");
ellipsoid(14, 19, 27, 3, 3, 4, "#e99a8b");
ellipsoid(34, 19, 27, 3, 3, 4, "#e99a8b");
ellipsoid(24, 12, 19, 10, 6, 11, beardShade);
ellipsoid(24, 10, 21, 10, 5, 8, cream);
for (const x of [17, 20, 24, 28, 31]) {
ellipsoid(x, 8, 16, x === 24 ? 3 : 2, 3, x === 24 ? 8 : 6, cream);
}
ellipsoid(20, 7, 24, 5, 3, 3, "#ffffff");
ellipsoid(28, 7, 24, 5, 3, 3, "#ffffff");
ellipsoid(24, 8, 14, 3, 3, 6, "#e5e8e7");
// Wide, kind eyes above the beard.
for (const x of [20, 28]) {
ellipsoid(x, 10, 29, 2, 2, 2, "#fffaf0");
box(x, 7, 29, x, 8, 30, "#263f4b");
set(x, 6, 30, "#ffffff");
}
ellipsoid(24, 6, 27, 4, 4, 3, "#f3a793");
ellipsoid(23, 3, 28, 2, 1, 1, "#ffc4ae");
// Tall, slightly crooked red hat and its broad brim.
ellipsoid(24, 22, 33, 15, 12, 2, "#9e292f");
ellipsoid(24, 21, 34, 14, 11, 1, "#c63b3b");
for (let z = 35; z <= 45; z++) {
const r = Math.max(1, 12 - (z - 35));
const cx = 24 - Math.floor((z - 35) / 3);
const cy = 23 + Math.floor((z - 35) / 6);
for (let x = cx - r; x <= cx + r; x++) {
for (let y = cy - r; y <= cy + r; y++) {
if (((x - cx) / r) ** 2 + ((y - cy) / Math.max(1, r * 0.86)) ** 2 <= 1) {
const color = y < cy - 2 ? "#dc4a48" : y > cy + 2 ? "#a82b33" : "#c7383b";
set(x, y, z, color);
}
}
}
}
ellipsoid(24, 13, 33, 13, 2, 1, "#b63136");
// One mitten tucked beside him; the other holds the lantern.
line(14, 22, 25, 10, 18, 19, 3, blue);
ellipsoid(9, 16, 18, 4, 4, 4, "#e9a28f");
line(34, 22, 25, 37, 17, 21, 3, blue);
ellipsoid(37, 14, 20, 3, 3, 3, "#e9a28f");
// Little brass lantern, hanging from his hand.
const lx = 39, ly = 13;
for (let z = 19; z <= 22; z++) {
set(39, 13, z, brass);
}
box(37, 11, 18, 41, 15, 19, "#9c6633");
box(36, 10, 16, 42, 16, 17, brass);
box(36, 10, 7, 42, 16, 8, "#9c6633");
box(37, 11, 6, 41, 15, 6, brass);
for (const x of [36, 42]) {
for (const y of [10, 16]) box(x, y, 8, x, y, 16, brass);
}
for (let z = 9; z <= 15; z++) {
set(39, 16, z, "#80582c");
}
set(39, 9, 17, "#ffe092");
set(39, 9, 7, "#e6b65b");
// The lantern's warm light flickers independently of its brass frame.
part("lantern", [lx, ly, 12]);
box(37, 11, 9, 41, 15, 15, "#ffbb39");
box(38, 10, 10, 40, 11, 14, "#ffe077");
box(39, 9, 11, 39, 10, 13, "#fff0a0");
animate("lantern", {
type: "colors",
palette: ["#ffb13b", "#ffe878", "#ff842c"],
pattern: "flicker",
glow: 0.8
});
// Each short leg has its own hip pivot for a waddling walk.
part("leftLeg", [19, 23, 12]);
ellipsoid(19, 23, 9, 5, 5, 6, brownLight);
ellipsoid(19, 18, 3, 5, 7, 3, boot);
ellipsoid(19, 14, 2, 5, 3, 2, bootLight);
box(16, 15, 0, 22, 21, 1, boot);
animate("leftLeg", { type: "swing", axis: "x", speed: 5, amplitude: 0.3 });
part("rightLeg", [29, 23, 12]);
ellipsoid(29, 23, 9, 5, 5, 6, brownLight);
ellipsoid(29, 18, 3, 5, 7, 3, boot);
ellipsoid(29, 14, 2, 5, 3, 2, bootLight);
box(26, 15, 0, 32, 21, 1, boot);
animate("rightLeg", { type: "swing", axis: "x", speed: -5, amplitude: 0.3 });
part("body", [24, 23, 20]);import { draw } from "./assets/voxel";
import { gnomo } from "./assets/gnomo";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, gnomo, 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 gnomo
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["gnomo"] })
# Queda en client/assets/gnomo.ts
# https://fogon.page/object/gnomo