fogón

← BásicoObjeto 3Dfogon/banana

Banana

de fogonCC02400 bloques
BananaArrastrá para girarlo
// «Banana» · gpt-6-sol (medium)
// Banana («Banana»).

// A curved, chunky banana with a golden peel and darkened stem tips.
const peel = ["#b88620", "#c99725", "#d9aa2c", "#e8bd35", "#f2cf40"];
const light = ["#f4d747", "#f9df50", "#ffe65a"];
const shadow = "#9b711d";

function curve(x) {
  const t = (x - 25) / 16;
  return 4 + 22 * t * t - 4 * t;
}

for (let x = 8; x <= 42; x++) {
  const taper = Math.min(1, (x - 7) / 6, (43 - x) / 5);
  const rz = 1.1 + 3.5 * taper;
  const ry = 1.2 + 3.5 * taper;
  const cy = 24 + 0.7 * Math.sin((x - 8) / 34 * Math.PI);
  const cz = curve(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 dy = (y - cy) / ry;
      const dz = (z - cz) / rz;
      if (dy * dy + dz * dz > 1.08) continue;

      let color;
      if (dz > 0.42) {
        color = light[Math.floor(rand() * light.length)];
      } else if (dz < -0.55) {
        color = rand() < 0.25 ? shadow : peel[0];
      } else if (dy < -0.35) {
        color = peel[2 + Math.floor(rand() * 3)];
      } else {
        color = peel[1 + Math.floor(rand() * 3)];
      }
      set(x, y, z, color);
    }
  }
}

// Long, slightly uneven peel ridges following the bend.
for (let x = 12; x <= 39; x++) {
  const z = Math.round(curve(x));
  if (get(x, 20, z + 1)) set(x, 20, z + 1, x % 5 === 0 ? "#ffe45a" : "#f3ce3c");
  if (get(x, 21, z - 1)) set(x, 21, z - 1, "#bd8e23");
  if (get(x, 26, z + 3)) set(x, 26, z + 3, "#ffe65a");
}

// The left end bends upward into a thick, dark stem.
box(8, 22, 32, 10, 26, 35, "#d3aa30");
box(7, 22, 35, 9, 25, 38, "#c59b2c");
box(7, 22, 38, 9, 25, 40, "#8b682d");
box(6, 22, 40, 9, 25, 41, "#6e542d");
box(7, 22, 42, 8, 24, 42, "#967542");
set(6, 22, 41, "#59482b");

// A few angular highlights on the upward-facing inside edge.
for (let x = 10; x <= 17; x++) {
  const z = Math.round(curve(x) + 2.5);
  if (get(x, 25, z)) set(x, 25, z, "#ffe65a");
}
for (let x = 34; x <= 41; x++) {
  const z = Math.round(curve(x) + 2);
  if (get(x, 25, z)) set(x, 25, z, "#fbe14d");
}

// Narrow, slightly hooked tip at the other end.
box(41, 23, 23, 43, 26, 25, "#d5aa2c");
box(42, 23, 25, 44, 25, 27, "#c79825");
box(43, 23, 28, 44, 25, 29, "#8b682b");
box(43, 23, 30, 44, 24, 30, "#694d25");
set(45, 24, 28, "#765525");