← Piratas y marObjeto 3Dfogon/pirata-pata-de-palo
Pirata con pata de palo
Arrastrá para girarlo// «Pirata con pata de palo» · gpt-6-sol (medium)
// A chubby cartoon pirate facing -y with a red and white striped shirt, a red bandana on the head, a big ginger beard, a gold earring, brown pants, one black boot and one wooden peg leg, holding a wooden mug.
// Chubby cartoon pirate, facing -y.
part("body", [24, 24, 0]);
const skin = "#f5b879";
const skinLight = "#ffd097";
const red = "#d83b36";
const redLight = "#ed5147";
const white = "#fff1d2";
const whiteShade = "#e4d8bb";
const brown = "#754323";
const wood = "#a96532";
const woodLight = "#cf8845";
const gold = "#ffd044";
// Wooden peg leg and its metal fittings.
cylinder(29, 24, 0, 2, 11, wood);
box(28, 22, 1, 29, 22, 9, woodLight);
cylinder(29, 24, 0, 2, 2, brown);
cylinder(29, 24, 9, 3, 2, gold);
// One oversized black boot.
box(15, 21, 0, 21, 29, 7, "#24252d");
box(15, 16, 0, 22, 25, 3, "#24252d");
box(15, 16, 0, 22, 28, 1, "#10151d");
box(16, 17, 3, 21, 21, 3, "#41424a");
box(15, 21, 7, 21, 28, 8, "#41424a");
// Puffy brown trousers, divided into two legs.
ellipsoid(24, 24, 13, 10, 8, 6, "#865039");
ellipsoid(19, 24, 10, 5, 6, 5, "#865039");
ellipsoid(29, 24, 11, 5, 6, 5, "#75432f");
box(15, 19, 8, 21, 27, 9, "#a06443");
box(26, 19, 9, 32, 27, 10, "#a06443");
// Solid rounded belly with broad horizontal shirt stripes.
for (let z = 13; z <= 31; z++) {
for (let y = 15; y <= 33; y++) {
for (let x = 12; x <= 36; x++) {
const d = ((x - 24) / 12) ** 2
+ ((y - 24) / 9) ** 2
+ ((z - 22) / 10) ** 2;
if (d > 1) continue;
const isRed = Math.floor((z - 14) / 3) % 2 === 0;
let color = isRed ? red : white;
if (y <= 20 || z >= 27) color = isRed ? redLight : "#fff9e7";
if (y >= 30 || z <= 17) color = isRed ? "#b92c32" : whiteShade;
if (rand() < 0.035) color = isRed ? "#c93435" : "#eee3c8";
set(x, y, z, color);
}
}
}
// Belt follows the round waist.
for (let x = 15; x <= 33; x++) {
for (let y = 16; y <= 31; y++) {
if (((x - 24) / 10) ** 2 + ((y - 24) / 8) ** 2 <= 1)
box(x, y, 13, x, y, 14, "#573523");
}
}
box(22, 15, 13, 26, 16, 15, gold);
box(23, 14, 14, 25, 15, 14, "#8d5622");
// Neck and cheerful face.
cylinder(24, 24, 29, 4, 5, skin);
ellipsoid(24, 24, 35, 7, 7, 7, skin);
ellipsoid(24, 18, 35, 5, 2, 4, skinLight);
// Ginger beard: broad cheeks, pointed chin, and a parted mustache.
ellipsoid(24, 17, 29, 8, 4, 5, "#a64b20");
ellipsoid(24, 15, 27, 5, 3, 5, "#b85a23");
ellipsoid(19, 17, 32, 3, 3, 5, "#b85a23");
ellipsoid(29, 17, 32, 3, 3, 5, "#a64b20");
ellipsoid(21, 14, 32, 4, 2, 2, "#d4712d");
ellipsoid(27, 14, 32, 4, 2, 2, "#d4712d");
box(22, 12, 28, 23, 12, 30, "#dd7930");
box(26, 12, 28, 27, 12, 30, "#c86425");
// Nose, bright eyes, thick brows, and a little smile.
ellipsoid(24, 15, 34, 2, 2, 2, skinLight);
box(20, 16, 36, 22, 16, 37, "#fffaf0");
box(26, 16, 36, 28, 16, 37, "#fffaf0");
set(21, 15, 36, "#273746");
set(27, 15, 36, "#273746");
box(20, 16, 38, 22, 17, 38, "#853b21");
box(26, 16, 38, 28, 17, 38, "#853b21");
box(23, 12, 31, 25, 12, 31, "#71351f");
// Red bandana, tied on the pirate's left.
ellipsoid(24, 24, 39, 8, 8, 3, red);
box(17, 17, 38, 31, 29, 39, red);
box(18, 16, 38, 30, 17, 39, redLight);
box(18, 19, 41, 29, 28, 41, redLight);
sphere(31, 28, 38, 2, "#b72b31");
line(32, 29, 38, 36, 30, 33, 1, red);
line(32, 29, 38, 33, 32, 32, 1, redLight);
// Shiny hoop earring, visible beside the beard.
set(16, 22, 34, gold);
set(15, 22, 33, gold);
set(15, 22, 32, gold);
set(16, 22, 31, gold);
set(17, 22, 31, "#d69b26");
// Sleeves and arms are separate shoulder-pivoted parts.
part("leftArm", [14, 24, 27]);
ellipsoid(13, 23, 26, 4, 4, 4, white);
box(10, 20, 25, 13, 24, 26, red);
line(12, 22, 25, 11, 19, 18, 2, skin);
sphere(11, 19, 17, 2, skinLight);
animate("leftArm", { type: "swing", axis: "x", speed: 3, amplitude: 0.25 });
part("rightArm", [34, 24, 27]);
ellipsoid(35, 23, 26, 4, 4, 4, red);
box(35, 20, 25, 38, 24, 26, white);
line(36, 22, 25, 37, 18, 18, 2, skin);
sphere(37, 18, 17, 2, skinLight);
// Chunky wooden drinking mug, gripped by the right hand.
cylinder(41, 16, 13, 4, 9, "#9c5a2e");
cylinder(41, 16, 13, 3, 9, wood);
box(39, 12, 14, 42, 12, 20, woodLight);
cylinder(41, 16, 13, 4, 1, "#754323");
cylinder(41, 16, 20, 4, 2, "#d5954b");
cylinder(41, 16, 21, 3, 1, "#533723");
box(38, 14, 15, 38, 18, 16, gold);
box(38, 14, 19, 38, 18, 20, gold);
box(35, 14, 16, 36, 18, 19, woodLight);
box(36, 14, 19, 38, 14, 20, woodLight);
box(36, 14, 15, 38, 14, 16, woodLight);
animate("rightArm", { type: "swing", axis: "x", speed: -3, amplitude: 0.25 });
animate("body", { type: "swing", axis: "y", speed: 3, amplitude: 0.08 });import { draw } from "./assets/voxel";
import { pirataPataDePalo } from "./assets/pirata-pata-de-palo";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, pirataPataDePalo, 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 pirata-pata-de-palo
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["pirata-pata-de-palo"] })
# Queda en client/assets/pirata-pata-de-palo.ts
# https://fogon.page/object/pirata-pata-de-palo