← AnimalesObjeto 3Dfogon/mapache
Mapache
Arrastrá para girarlo// «Mapache» · gpt-6-sol (medium)
// A cute cartoon raccoon, horizontal along y, head at the front (-y): a grey round body, four small dark legs, a face with a black bandit mask around the eyes, a white muzzle with a black nose, white-edged pointy ears and a big bushy tail ringed in dark and light grey.
const grey = "#858b8d";
const lightGrey = "#aeb5b4";
const darkGrey = "#50565b";
const charcoal = "#292b31";
const cream = "#f2eee2";
// Rounded body, shaded lighter across the back.
for (let x = 12; x <= 36; x++)
for (let y = 11; y <= 38; y++)
for (let z = 7; z <= 28; z++) {
const d = ((x - 24) / 12) ** 2 +
((y - 25) / 13) ** 2 +
((z - 17) / 10) ** 2;
if (d <= 1) {
let c = z < 12 ? "#696f72" : z > 21 ? "#a0a7a6" : grey;
if (rand() < 0.055) c = z > 19 ? lightGrey : "#747b7d";
set(x, y, z, c);
}
}
// Big, upward-curving tail. Bands run across its length.
for (let y = 34; y <= 47; y++) {
const t = y - 34;
const width = [3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 6, 5, 4, 3][t];
const height = Math.min(6, width + 1);
const cz = 18 + t * 0.77;
const band = t >= 11 || (t >= 3 && t <= 5) || (t >= 9 && t <= 10);
for (let x = 24 - width; x <= 24 + width; x++)
for (let z = Math.floor(cz - height); z <= Math.ceil(cz + height); z++) {
if (((x - 24) / width) ** 2 + ((z - cz) / height) ** 2 <= 1) {
let c = band
? (z > cz ? "#555b60" : "#373c42")
: (z > cz ? "#c1c7c3" : "#949c9b");
if (rand() < 0.045) c = band ? "#666c70" : "#d1d3cc";
set(x, y, z, c);
}
}
}
// Oversized round head.
for (let x = 13; x <= 35; x++)
for (let y = 3; y <= 21; y++)
for (let z = 13; z <= 33; z++) {
const d = ((x - 24) / 11) ** 2 +
((y - 12) / 9) ** 2 +
((z - 23) / 10) ** 2;
if (d <= 1) {
let c = z > 27 ? "#aab1af" : z < 19 ? "#777e80" : "#919a9a";
if (rand() < 0.045) c = z > 25 ? "#c0c5bf" : "#81898a";
set(x, y, z, c);
}
}
// Pointed ears with pale edges and dark inset fronts.
for (const side of [-1, 1]) {
for (let z = 30; z <= 40; z++) {
const h = z - 30;
const cx = 24 + side * (8 + h * 0.31);
const half = Math.max(0.7, 4 - h * 0.34);
const depth = Math.max(1, 3.2 - h * 0.19);
for (let x = Math.floor(cx - half); x <= Math.ceil(cx + half); x++)
for (let y = Math.floor(9 - depth); y <= Math.ceil(9 + depth); y++) {
if (((x - cx) / half) ** 2 + ((y - 9) / depth) ** 2 <= 1)
set(x, y, z, cream);
}
}
ellipsoid(24 + side * 8.4, 6.7, 34, 2.5, 1.15, 3.1, charcoal);
ellipsoid(24 + side * 8.4, 5.8, 33, 1.5, 0.8, 1.7, "#6b7072");
}
// Bold bandit mask, divided into two rounded eye patches.
ellipsoid(19, 4.1, 25.6, 4.6, 2.4, 3.7, charcoal);
ellipsoid(29, 4.1, 25.6, 4.6, 2.4, 3.7, charcoal);
box(21, 4, 24, 27, 5, 27, charcoal);
// Bright muzzle and cheek puffs.
ellipsoid(20.5, 4.1, 19.6, 3.8, 2.8, 3.2, cream);
ellipsoid(27.5, 4.1, 19.6, 3.8, 2.8, 3.2, cream);
ellipsoid(24, 2.9, 18.6, 3.5, 2.1, 2.4, "#e3e0d5");
// Simple shiny dot eyes, visible against the mask.
for (const x of [19, 29]) {
ellipsoid(x, 1.9, 26.4, 1.35, 0.85, 1.45, "#090b10");
set(x - 1, 1, 27, "#ffffff");
}
// Nose and a tiny smiling mouth.
ellipsoid(24, 1.1, 21, 2.15, 1.35, 1.6, "#17191d");
set(24, 0, 19, "#424044");
set(23, 1, 18, "#575154");
set(25, 1, 18, "#575154");
// Four independent, short walking legs.
function leg(name, x, y, speed) {
part(name, [x, y, 11]);
ellipsoid(x, y, 6, 3.25, 3.25, 6, darkGrey);
ellipsoid(x, y - 1.1, 2, 3.6, 3.4, 2, charcoal);
ellipsoid(x, y + 1.5, 8, 2.4, 1.5, 3.4, "#61676a");
for (const dx of [-2, 0, 2])
set(x + dx, y - 4, 1, "#656b6d");
animate(name, { type: "swing", axis: "x", speed, amplitude: 0.3 });
}
leg("front-left", 16, 17, 5);
leg("front-right", 32, 17, -5);
leg("rear-left", 16, 32, -5);
leg("rear-right", 32, 32, 5);
part("body");import { draw } from "./assets/voxel";
import { mapache } from "./assets/mapache";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, mapache, 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 mapache
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["mapache"] })
# Queda en client/assets/mapache.ts
# https://fogon.page/object/mapache