← AnimalesObjeto 3Dfogon/camaleon
Camaleón
Arrastrá para girarlo// «Camaleón» · gpt-6-sol (medium)
// A cartoon chameleon on a short branch, horizontal along y, head at the front (-y): a body with a ridged back, a curly spiral tail, a helmet-shaped head with big round turret eyes, and four feet gripping the branch.
// The branch rests on the floor and runs from front to back.
part("branch", [24, 24, 3]);
cylinder(24, 4, 3, 3, 40, "#86502d", "y");
line(23, 5, 5, 23, 42, 5, 0, "#b87942");
line(26, 8, 5, 26, 39, 5, 0, "#a76636");
for (let y = 8; y < 42; y += 7) {
line(21, y, 3, 22, y + 2, 4, 0, "#60391f");
line(27, y + 2, 4, 28, y + 4, 3, 0, "#60391f");
}
ellipsoid(24, 4, 3, 3, 1, 3, "#bd8249");
ellipsoid(24, 4, 3, 1, 1, 2, "#8e562e");
// Main skin: this is the color-changing part.
part("body", [24, 24, 19]);
ellipsoid(24, 25, 19, 8, 12, 8, "#54bd56");
ellipsoid(24, 12, 24, 9, 8, 8, "#65cd5c");
ellipsoid(24, 15, 28, 8, 6, 5, "#71d663"); // helmet-like crown
ellipsoid(24, 6, 20, 7, 4, 4, "#75d56b"); // broad little snout
ellipsoid(24, 9, 29, 8, 3, 2, "#80dc69"); // raised brow
// A spiral curled off to one side, visible from above.
const coil = [
[25, 34], [29, 37], [33, 40], [37, 41],
[40, 39], [40, 35], [38, 32], [35, 31],
[32, 33], [31, 36], [33, 38], [36, 38], [37, 36]
];
for (let i = 1; i < coil.length; i++) {
line(coil[i - 1][0], coil[i - 1][1], 19,
coil[i][0], coil[i][1], 19, 2, "#4bb84f");
}
sphere(37, 36, 19, 2, "#67cc59");
// Four short legs reach down around the branch.
for (const y of [18, 31]) {
for (const side of [-1, 1]) {
const shoulderX = 24 + side * 7;
const outerX = 24 + side * 9;
const pawX = 24 + side * 4;
line(shoulderX, y, 17, outerX, y, 11, 3, "#47ab4c");
line(outerX, y, 11, pawX, y, 8, 2, "#59bf52");
ellipsoid(pawX, y, 8, 2, 2, 2, "#6cd05a");
}
}
animate("body", {
type: "colors",
palette: ["#54bf55", "#35b9ad", "#e5d64d", "#ee9242"],
pattern: "wave",
glow: 0.1
});
// Markings and toes stay distinct as the skin changes color.
part("markings", [24, 24, 19]);
ellipsoid(24, 15, 16, 5, 5, 3, "#c7ed87");
ellipsoid(24, 6, 19, 6, 2, 2, "#a9e878");
// Chunky ridges along the back.
for (let y = 20; y <= 35; y += 3) {
const height = y < 29 ? 29 : 28;
ellipsoid(24, y, height, 3, 2, 2, "#318f49");
box(23, y, height, 25, y + 1, height + 2, "#83d963");
}
// Bold stripes across the upper body.
for (const y of [23, 29, 34]) {
for (const side of [-1, 1]) {
ellipsoid(24 + side * 5, y, 24, 2, 1, 1, "#348f49");
}
}
for (const side of [-1, 1]) {
for (const y of [21, 26, 32]) {
sphere(24 + side * 7, y, 20, 1, "#a1e774");
}
}
// Two split toes per foot curl over the top of the wood.
for (const y of [18, 31]) {
for (const side of [-1, 1]) {
const x = 24 + side * 4;
for (const offset of [-1, 1]) {
line(x, y + offset, 8, x - side * 2, y + offset, 6, 1, "#3d9d48");
}
}
}
// Smile and nostrils on the forward-facing snout.
set(21, 3, 21, "#347d43");
set(27, 3, 21, "#347d43");
line(20, 3, 18, 23, 2, 17, 0, "#397b3f");
line(23, 2, 17, 27, 3, 18, 0, "#397b3f");
// Big swivelling eye turrets, with simple dot pupils.
part("eyes", [24, 12, 28]);
for (const side of [-1, 1]) {
const x = 24 + side * 9;
sphere(x, 11, 28, 4, "#429e4c");
sphere(x + side, 9, 29, 3, "#f7f7db");
sphere(x + side, 6, 29, 1, "#172b27");
set(x + side, 5, 30, "#ffffff");
}
animate("eyes", { type: "spin", axis: "z", speed: 0.18 });import { draw } from "./assets/voxel";
import { camaleon } from "./assets/camaleon";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, camaleon, 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 camaleon
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["camaleon"] })
# Queda en client/assets/camaleon.ts
# https://fogon.page/object/camaleon