fogón

← Level kit3D assetfogon/nivel-corazon

Corazón

by fogonCC04293 blocks
CorazónDrag to turn it
// «Corazón» · gpt-6-sol (medium)
// A chunky red heart collectible standing upright, facing -y: about 30 wide and 28 tall, 8 blocks thick on y, centered at x 24, its bottom tip touching z 0. Built from two spheres for the lobes and a tapering wedge for the point, smoothly joined. Bright red with a lighter pink-white glossy highlight on the upper left lobe, darker red on the lower edges and the back. The whole heart is one part that spins and bobs.

part("corazon", [24, 24, 14]);

const cx = 24;
const cy = 23.5;

for (let z = 0; z <= 29; z++) {
  const halfWidth = z <= 14
    ? 0.7 + z * 0.96
    : 14.14 + Math.min(z - 14, 5) * 0.17;

  for (let x = 8; x <= 40; x++) {
    for (let y = 19; y <= 28; y++) {
      const lobeL =
        ((x - 17) / 8.5) ** 2 +
        ((y - cy) / 4.25) ** 2 +
        ((z - 20) / 8.5) ** 2 <= 1;
      const lobeR =
        ((x - 31) / 8.5) ** 2 +
        ((y - cy) / 4.25) ** 2 +
        ((z - 20) / 8.5) ** 2 <= 1;

      // The solid wedge joins the lobes and narrows to a floor-touching tip.
      const wedgeDepth = z < 4 ? Math.max(1, 3.5 - z * 0.7) : 3.5;
      const wedge =
        z <= 20 &&
        Math.abs(x - cx) <= halfWidth &&
        Math.abs(y - cy) <= wedgeDepth;

      if (!lobeL && !lobeR && !wedge) continue;

      let color = "#f3263d";
      if (z >= 20 && y <= 23) color = "#ff394e";
      if (z < 8 || y >= 27) color = "#cf1934";
      if (z < 3 || y === 28) color = "#ad1730";
      if (rand() < 0.025 && z >= 8 && y <= 25) color = "#ff4054";
      set(x, y, z, color);
    }
  }
}

// Small raised glints follow the visible front of the upper-left lobe.
function frontAt(x, z) {
  for (let y = 19; y <= 28; y++) {
    if (get(x, y, z)) return y;
  }
  return null;
}

for (let z = 23; z <= 27; z++) {
  for (let x = 11; x <= 18; x++) {
    const sheen = (x - 14.5) ** 2 / 13 + (z - 25) ** 2 / 5;
    if (sheen > 1) continue;
    const y = frontAt(x, z);
    if (y !== null) {
      set(x, y - 1, z, sheen < 0.32 ? "#fff1ed" : "#ffabb5");
    }
  }
}

for (const [x, z] of [[19, 23], [20, 23], [19, 24]]) {
  const y = frontAt(x, z);
  if (y !== null) set(x, y - 1, z, "#ff788b");
}

animate("corazon", { type: "spin", axis: "z", speed: -2 });
animate("corazon", { type: "bob", axis: "z", amplitude: 1.5 });