fogón

← AnimalesObjeto 3Dfogon/medusa

Medusa

de fogonCC012710 bloques
MedusaArrastrá para girarlo
// «Medusa» · gpt-6-sol (medium)
// A cartoon jellyfish floating: a translucent-looking pink and lilac dome bell with lighter spots, a frilly edge underneath, and long wavy thin tentacles hanging down to the floor in pink and light purple.

const pink = "#f39bcc";
const lilac = "#dba8eb";
const purple = "#bd8edb";

// Long, gently waving tentacles. They stay in place while the bell bobs.
for (let i = 0; i < 12; i++) {
  const a = (i / 12) * Math.PI * 2;
  const baseR = i % 3 === 0 ? 5 : i % 2 === 0 ? 9 : 11;
  const bottom = i < 7 ? 0 : 2 + (i % 4) * 2;
  const phase = i * 1.7;
  const colors = i % 3 === 0
    ? [pink, "#e985bd"]
    : i % 3 === 1
      ? [lilac, "#c590dd"]
      : ["#eab1ee", purple];

  let prev = null;
  for (let z = 26; z >= bottom; z--) {
    const drop = (26 - z) / 26;
    const outward = baseR + drop * (i % 2 === 0 ? 2 : 1);
    const wave = Math.sin(z * 0.38 + phase) * (0.5 + drop * 1.7);
    const x = Math.round(24 + Math.cos(a) * outward - Math.sin(a) * wave);
    const y = Math.round(24 + Math.sin(a) * outward + Math.cos(a) * wave);
    const color = colors[z % 7 < 4 ? 0 : 1];
    if (prev) line(prev[0], prev[1], prev[2], x, y, z,
                   i % 4 === 0 ? 1 : 0, color);
    prev = [x, y, z];
  }
}

// A few shorter, delicate tendrils between the main ones.
for (let i = 0; i < 7; i++) {
  const a = (i + 0.4) * Math.PI * 2 / 7;
  let prev = null;
  for (let z = 25; z >= 8 + i % 4; z--) {
    const x = Math.round(24 + 5 * Math.cos(a) + 1.8 * Math.sin(z * 0.48 + i));
    const y = Math.round(24 + 5 * Math.sin(a) + 1.8 * Math.cos(z * 0.43 + i));
    if (prev) line(prev[0], prev[1], prev[2], x, y, z, 0, "#f3b6e5");
    prev = [x, y, z];
  }
}

part("bell", [24, 24, 28]);

// Solid, rounded bell with a softly shaded lower edge.
for (let z = 26; z <= 44; z++) {
  const level = (z - 26) / 18;
  for (let x = 6; x <= 42; x++) {
    for (let y = 8; y <= 40; y++) {
      const nx = (x - 24) / 18;
      const ny = (y - 24) / 16;
      const d = nx * nx + ny * ny + level * level;
      if (d > 1) continue;

      let color = z < 30 ? "#d78dca"
                : z < 36 ? "#eaa8db"
                : "#f7c3e9";
      if (d > 0.82) color = z < 32 ? "#c988cb" : "#e8a8de";
      if (z > 35 && d < 0.75) color = "#facdef";
      if (rand() < 0.055) color = z < 34 ? "#e5a0d6" : "#f5b7e7";
      set(x, y, z, color);
    }
  }
}

// Pale spots following the curved top of the bell.
const spots = [
  [16, 16, 2], [23, 13, 2], [32, 16, 3], [37, 24, 2],
  [30, 30, 2], [19, 32, 3], [12, 25, 2], [25, 23, 2],
  [27, 37, 2]
];
for (const [sx, sy, r] of spots) {
  for (let x = sx - r; x <= sx + r; x++) {
    for (let y = sy - r; y <= sy + r; y++) {
      if ((x - sx) ** 2 + (y - sy) ** 2 > r * r) continue;
      const q = 1 - ((x - 24) / 18) ** 2 - ((y - 24) / 16) ** 2;
      if (q <= 0) continue;
      const z = 26 + Math.floor(18 * Math.sqrt(q));
      set(x, y, z + 1, (sx + sy) % 2 ? "#ffe1f4" : "#f9d8fa");
    }
  }
}

// Scalloped, frilly rim, hanging just below the bell.
for (let i = 0; i < 20; i++) {
  const a = i * Math.PI * 2 / 20;
  const x = 24 + 16.5 * Math.cos(a);
  const y = 24 + 14.5 * Math.sin(a);
  sphere(x, y, 26, 2.3, i % 2 ? "#eaa2d6" : "#f5b4e3");
  sphere(x, y, i % 2 ? 24 : 25, 1.5,
         i % 2 ? "#d789cb" : "#eaa2d9");
}

// Friendly face on the front of the bell.
sphere(19, 9, 32, 1.4, "#30233f");
sphere(29, 9, 32, 1.4, "#30233f");
set(19, 8, 33, "#ffffff");
set(29, 8, 33, "#ffffff");
set(22, 7, 30, "#943f89");
set(23, 7, 29, "#943f89");
set(24, 7, 29, "#943f89");
set(25, 7, 29, "#943f89");
set(26, 7, 30, "#943f89");

animate("bell", { type: "bob", axis: "z", speed: 2, amplitude: 2 });
animate("bell", {
  type: "colors",
  palette: ["#f3a6d7", "#e5b4ed", "#cfa8ed"],
  pattern: "pulse",
  glow: 0.4
});