fogón

← Nature3D assetfogon/ceibo

Ceibo

by fogonCC014906 blocks
CeiboDrag to turn it
// «Ceibo» · gpt-6-sol (medium)
// A ceibo tree: a twisted greyish trunk with an irregular crown of green leaves dotted with many bright crimson-red flower clusters.

// Twisted, grey-brown trunk and spreading roots.
const bark = "#858477";
line(24, 24, 1, 26, 24, 8, 4, bark);
line(26, 24, 8, 22, 25, 15, 3, bark);
line(22, 25, 15, 24, 24, 22, 3, bark);

for (const [x, y] of [[17, 23], [31, 22], [20, 17], [27, 31], [18, 29]]) {
  line(24, 24, 5, x, y, 0, 2, "#77786d");
}
box(22, 22, 0, 26, 26, 2, bark);

// Bark shading and short, winding grooves.
forEach((x, y, z, color) => {
  if (z > 22 || color !== bark) return;
  if (rand() < 0.17) set(x, y, z, "#a09d8d");
  else if (rand() < 0.13) set(x, y, z, "#706f66");
});
for (const [a, b] of [
  [[23, 20, 3], [26, 21, 9]],
  [[26, 21, 9], [22, 22, 15]],
  [[22, 22, 15], [23, 21, 20]],
  [[28, 24, 3], [27, 27, 10]],
  [[20, 25, 5], [21, 28, 12]]
]) {
  line(...a, ...b, 0, "#64675e");
}

// The branches, leaves, and blossoms all sway together.
part("crown", [24, 24, 21]);
for (const [x, y, z, r] of [
  [13, 18, 30, 2], [34, 18, 31, 2], [36, 30, 30, 2],
  [17, 34, 30, 2], [24, 24, 37, 2]
]) {
  line(24, 24, 21, x, y, z, r, "#77796a");
}

// Overlapping rounded leaf masses make an uneven, broad crown.
const leaf = "#39a947";
ellipsoid(24, 24, 32, 12, 11, 9, leaf);
for (const [x, y, z, rx, ry, rz] of [
  [13, 18, 32, 8, 8, 7],
  [33, 17, 33, 9, 8, 7],
  [35, 29, 32, 8, 9, 7],
  [17, 33, 33, 9, 8, 7],
  [24, 25, 37, 9, 9, 6],
  [10, 27, 30, 6, 7, 6],
  [29, 36, 30, 7, 6, 6],
  [24, 11, 30, 7, 6, 6],
  [16, 24, 25, 6, 6, 5],
  [32, 23, 26, 6, 6, 5]
]) {
  ellipsoid(x, y, z, rx, ry, rz, leaf);
}

// Sunlit tops, darker undersides, and flecks of leafy variation.
forEach((x, y, z, color) => {
  if (color !== leaf) return;
  const n = rand();
  if (z >= 36) set(x, y, z, n < 0.38 ? "#71cf55" : "#54be4b");
  else if (z < 29) set(x, y, z, n < 0.32 ? "#278c42" : "#329b43");
  else if (n < 0.28) set(x, y, z, "#58bc4b");
  else if (n < 0.38) set(x, y, z, "#298e40");
});

// Pick exposed leaf blocks before adding flowers, so blossoms stay on
// the outside of the crown.
const sites = [];
forEach((x, y, z, color) => {
  if (z < 24 || ![
    "#39a947", "#71cf55", "#54be4b",
    "#278c42", "#329b43", "#58bc4b", "#298e40"
  ].includes(color)) return;

  const top = !get(x, y, z + 1);
  const front = !get(x, y - 1, z);
  const side = !get(x - 1, y, z) || !get(x + 1, y, z);
  if ((top || front || side) && rand() < 0.043) {
    sites.push([x, y, z, top, front]);
  }
});

// Chunky crimson flower clusters, with warm highlights.
for (const [x, y, z, top, front] of sites) {
  const dy = front ? -1 : 0;
  const dz = top ? 1 : 0;
  set(x, y, z, "#c72738");
  set(x, y + dy, z + dz, "#e6323e");
  if (rand() < 0.8) set(x + 1, y + dy, z + dz, "#d82537");
  if (rand() < 0.7) set(x - 1, y + dy, z + dz, "#c91f34");
  if (rand() < 0.7) set(x, y + dy, z + dz + 1, "#f04446");
  if (rand() < 0.22) set(x, y + dy - 1, z + dz, "#f26a48");
}

animate("crown", {
  type: "swing",
  axis: "y",
  speed: 1.2,
  amplitude: 0.08
});