← AnimalesObjeto 3Dfogon/elefante
Elefante
Arrastrá para girarlo// «Elefante» · gpt-6-sol (medium)
// A big chubby cartoon grey elephant, horizontal along y, head at the front (-y): a massive rounded body, four thick pillar legs with pale toenails, a big head with huge flat round ears sticking out to the sides (pink inside), small black eyes, two short white tusks and a long trunk curling down to the ground. A thin tail with a tuft at the back.
const grey = ["#747a80", "#878d92", "#969ca0", "#a5aaad"];
function roundedGrey(cx, cy, cz, rx, ry, rz) {
for (let x = Math.floor(cx - rx); x <= Math.ceil(cx + rx); x++)
for (let y = Math.floor(cy - ry); y <= Math.ceil(cy + ry); y++)
for (let z = Math.floor(cz - rz); z <= Math.ceil(cz + rz); z++) {
const d =
((x - cx) / rx) ** 2 +
((y - cy) / ry) ** 2 +
((z - cz) / rz) ** 2;
if (d > 1) continue;
let shade = z < cz - rz * 0.42 ? 0 : z > cz + rz * 0.28 ? 2 : 1;
if (z > cz + rz * 0.72) shade = 3;
if (rand() < 0.07)
shade = Math.max(0, Math.min(3, shade + (rand() < 0.5 ? -1 : 1)));
set(x, y, z, grey[shade]);
}
}
// Solid, rounded body and oversized face.
roundedGrey(24, 26, 23, 14, 15, 13);
roundedGrey(24, 13, 27, 11, 9, 11);
ellipsoid(16, 10, 23, 4, 4, 5, "#90969a");
ellipsoid(32, 10, 23, 4, 4, 5, "#90969a");
// Thin tail with a dark tuft.
line(24, 40, 25, 24, 44, 20, 1, "#777d82");
line(24, 44, 20, 24, 45, 17, 1, "#777d82");
ellipsoid(24, 45, 16, 2, 1.5, 3, "#555c61");
set(23, 45, 14, "#666d71");
set(25, 45, 15, "#666d71");
// Four individually swinging legs, each with a flat sole at z=0.
function leg(name, x, y, speed) {
part(name, [x, y, 16]);
cylinder(x, y, 3, 4, 12, "#80868b");
ellipsoid(x, y, 11, 4.5, 4.5, 7, "#8d9397");
ellipsoid(x, y - 0.4, 3, 4.8, 5, 3, "#777d82");
ellipsoid(x, y - 0.6, 4, 4.5, 4.7, 3, "#92989b");
// Solid rounded sole explicitly touches the floor.
for (let dx = -4; dx <= 4; dx++)
for (let dy = -4; dy <= 4; dy++)
if (dx * dx + dy * dy <= 16)
set(x + dx, y + dy, 0, "#747a80");
for (const dx of [-2, 0, 2]) {
ellipsoid(x + dx, y - 4.5, 1.5, 1.15, 1.2, 1.4, "#e6dfd2");
set(x + dx, y - 5, 1, "#f6eee0");
set(x + dx, y - 4, 0, "#e6dfd2");
}
animate(name, { type: "swing", axis: "x", speed, amplitude: 0.3 });
}
leg("frontLeft", 16, 16, 5);
leg("frontRight", 32, 16, -5);
leg("rearLeft", 16, 35, -5);
leg("rearRight", 32, 35, 5);
// Wide, flat ears with pink insets facing the viewer.
part("leftEar", [14, 13, 30]);
ellipsoid(8, 12, 29, 6, 3, 10, "#72787e");
ellipsoid(8, 11, 30, 5.5, 2, 8.7, "#989da1");
ellipsoid(8, 9.3, 29, 4.6, 1.4, 7.4, "#cf8892");
ellipsoid(8, 8.5, 30, 3.3, 0.6, 5.5, "#e7a6aa");
animate("leftEar", { type: "swing", axis: "z", speed: 2, amplitude: 0.2 });
part("rightEar", [34, 13, 30]);
ellipsoid(40, 12, 29, 6, 3, 10, "#72787e");
ellipsoid(40, 11, 30, 5.5, 2, 8.7, "#989da1");
ellipsoid(40, 9.3, 29, 4.6, 1.4, 7.4, "#cf8892");
ellipsoid(40, 8.5, 30, 3.3, 0.6, 5.5, "#e7a6aa");
animate("rightEar", { type: "swing", axis: "z", speed: -2, amplitude: 0.2 });
part("body");
// Tiny, shiny black eyes.
sphere(18, 6, 31, 1.7, "#22272b");
sphere(30, 6, 31, 1.7, "#22272b");
set(17, 4, 32, "#ffffff");
set(29, 4, 32, "#ffffff");
// Two short ivory tusks.
for (const x of [17, 31]) {
const outward = x < 24 ? -1 : 1;
line(x, 8, 20, x + outward, 4, 17, 1.5, "#d8d3c9");
line(x + outward, 4, 17, x + outward, 2, 19, 1, "#fff4df");
set(x + outward, 2, 20, "#fff7e9");
}
// Long, chunky trunk curling near the ground.
part("trunk", [24, 5, 23]);
line(24, 5, 23, 24, 3, 13, 3, "#858b90");
line(24, 3, 13, 25, 4, 7, 2.8, "#858b90");
line(25, 4, 7, 27, 5, 3, 2.7, "#777e83");
line(27, 5, 3, 30, 5, 4, 2.5, "#858b90");
line(30, 5, 4, 31, 5, 7, 2.1, "#969b9e");
line(24, 2, 20, 24, 2, 14, 1, "#a3a8aa");
ellipsoid(31, 3, 8, 1, 0.7, 1, "#555c61");
animate("trunk", { type: "swing", axis: "x", speed: 2, amplitude: 0.3 });
part("body");import { draw } from "./assets/voxel";
import { elefante } from "./assets/elefante";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, elefante, 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 elefante
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["elefante"] })
# Queda en client/assets/elefante.ts
# https://fogon.page/object/elefante