fogón

← AnimalesObjeto 3Dfogon/jirafa

Jirafa

de fogonCC05897 bloques
JirafaArrastrá para girarlo
// «Jirafa» · gpt-6-sol (medium)
// A cartoon giraffe, horizontal along y, head at the front (-y): a body with four long thin legs, a very long neck rising up and slightly forward to a small head with two short ossicone horns with brown tips, small ears, black eyes and a lighter muzzle. Pale yellow coat covered with irregular brown patches, a short tail with a black tuft. Uses most of the height of the grid.

const coat = "#f3c653";
const coatLight = "#ffdb72";
const coatShade = "#dca440";
const spot = "#ad6331";
const spotDark = "#914b28";
const hoof = "#654534";

function fur(z) {
  return rand() < 0.055 ? coatLight : z < 18 ? coatShade : coat;
}

// Rounded, horizontal body. Patch shapes are painted into its surface.
const sidePatches = [
  [19, 21, 2.5, 2.5], [24, 24, 2.8, 2.2],
  [29, 20, 3.1, 2.9], [35, 23, 2.5, 2.5],
  [36, 17, 1.9, 1.8], [23, 17, 1.8, 1.6]
];
const topPatches = [
  [19, 23, 2.5, 2.7], [27, 20, 2.5, 2.4],
  [23, 29, 2.9, 2.7], [28, 34, 2.3, 2.5],
  [19, 35, 1.9, 2.0]
];

for (let x = 14; x <= 34; x++)
  for (let y = 15; y <= 39; y++)
    for (let z = 13; z <= 27; z++) {
      const d = ((x - 24) / 10) ** 2 +
                ((y - 27) / 12) ** 2 +
                ((z - 20) / 7) ** 2;
      if (d > 1) continue;

      let patched = false;
      if (Math.abs(x - 24) > 5 && z < 25) {
        for (const [py, pz, ry, rz] of sidePatches) {
          const edge = ((y - py) / ry) ** 2 + ((z - pz) / rz) ** 2;
          if (edge < 1 + (rand() - 0.5) * 0.27) patched = true;
        }
      }
      if (z >= 23) {
        for (const [px, py, rx, ry] of topPatches) {
          const edge = ((x - px) / rx) ** 2 + ((y - py) / ry) ** 2;
          if (edge < 1 + (rand() - 0.5) * 0.25) patched = true;
        }
      }
      set(x, y, z, patched ? (rand() < 0.13 ? spotDark : spot) : fur(z));
    }

// Four individually swinging legs.
function leg(name, x, y, speed) {
  part(name, [x, y, 17]);
  for (let z = 3; z <= 18; z++)
    for (let dx = -2; dx <= 2; dx++)
      for (let dy = -2; dy <= 2; dy++) {
        if (dx * dx + dy * dy > 5) continue;
        const marked = (z >= 9 && z <= 12 && dy < 1 && dx > 0) ||
                       (z >= 14 && z <= 16 && dy > 0 && dx < 0);
        set(x + dx, y + dy, z, marked ? spot : fur(z));
      }
  ellipsoid(x, y - 0.5, 1.5, 2.5, 3, 1.5, hoof);
  box(x - 1, y - 3, 0, x + 1, y - 2, 2, "#785238");
  animate(name, { type: "swing", axis: "x", speed, amplitude: 0.25 });
}
leg("frontLeft", 19, 20, 5);
leg("frontRight", 29, 20, -5);
leg("rearLeft", 19, 34, -5);
leg("rearRight", 29, 34, 5);

// Short tail and its dark, rounded tuft.
line(24, 38, 22, 24, 43, 20, 1, coatShade);
ellipsoid(24, 45, 19, 1.6, 2.4, 2.2, "#29241f");
set(24, 46, 18, "#3b3027");

// The whole neck and head sway together from the shoulder.
part("neckAndHead", [24, 18, 25]);
for (let z = 24; z <= 39; z++) {
  const cy = 18 - (z - 25) * 0.29;
  for (let x = 20; x <= 28; x++)
    for (let y = 10; y <= 22; y++) {
      const d = ((x - 24) / 3.6) ** 2 + ((y - cy) / 3.1) ** 2;
      if (d > 1) continue;
      const patchBand =
        (z >= 27 && z <= 29 && (x <= 22 || y < cy - 1)) ||
        (z >= 32 && z <= 34 && (x >= 26 || y > cy + 1)) ||
        (z >= 36 && z <= 37 && x <= 21);
      set(x, y, z, patchBand && rand() > 0.13 ? spot : fur(z));
    }
}

// Soft, oversized toy-like head and pale projecting muzzle.
ellipsoid(24, 11, 40, 5, 4.5, 4, coatLight);
ellipsoid(24, 6.5, 38.5, 3.6, 3.7, 2.4, "#ffe49a");
ellipsoid(24, 5, 37, 3, 2, 1, "#f2cb76");

// Ears, broad at the base and darker inside.
ellipsoid(17.5, 12, 42, 2.7, 1.6, 1.5, coat);
ellipsoid(30.5, 12, 42, 2.7, 1.6, 1.5, coat);
set(16, 11, 42, "#b7753b");
set(32, 11, 42, "#b7753b");

// Two short ossicones with unmistakable brown tips.
for (const x of [21, 27]) {
  cylinder(x, 12, 43, 1, 3, coat);
  ellipsoid(x, 12, 46, 1.3, 1.3, 1.2, spotDark);
}

// Simple dot eyes, tiny highlights, nostrils and a smile.
sphere(21, 7, 41, 1, "#24201e");
sphere(27, 7, 41, 1, "#24201e");
set(21, 6, 42, "#ffffff");
set(27, 6, 42, "#ffffff");
set(22, 3, 39, "#9e7047");
set(26, 3, 39, "#9e7047");
line(23, 3, 37, 25, 3, 37, 0, "#a46d40");

animate("neckAndHead", {
  type: "swing", axis: "x", speed: 1.5, amplitude: 0.12
});