fogón

← NaturalezaObjeto 3Dfogon/rosal

Rosal

de fogonCC014549 bloques
RosalArrastrá para girarlo
// «Rosal» · gpt-6-sol (medium)
// A small rose bush: a dark green leafy shrub with several red roses and a couple of pink buds.

// A chunky, storybook rose bush.
const bark = "#80502e";
const darkBark = "#60391f";
const greens = ["#185c32", "#20743b", "#298b43", "#39a84e", "#57bb60"];

// Trunk and spreading roots.
cylinder(24, 24, 0, 3, 16, bark);
for (const [x, y] of [[17, 22], [31, 23], [22, 17], [26, 31]]) {
  line(24, 24, 3, x, y, 0, 1, bark);
}
line(23, 21, 2, 23, 21, 13, 0, darkBark);
line(26, 26, 3, 26, 26, 12, 0, darkBark);

// Solid, irregular foliage, darker underneath.
ellipsoid(24, 24, 17, 14, 13, 10, greens[0]);
for (const [x, y, z, rx, ry, rz] of [
  [15, 21, 18, 8, 9, 8], [33, 23, 18, 8, 9, 8],
  [22, 15, 20, 9, 7, 8], [27, 32, 20, 9, 8, 8],
  [18, 30, 19, 7, 7, 8], [29, 18, 24, 8, 7, 7]
]) ellipsoid(x, y, z, rx, ry, rz, greens[1]);

// Rounded leaf clumps give the bush a scalloped silhouette.
for (let i = 0; i < 85; i++) {
  const a = rand() * Math.PI * 2;
  const x = 24 + Math.cos(a) * (8 + rand() * 9);
  const y = 24 + Math.sin(a) * (7 + rand() * 9);
  const z = 12 + rand() * 15;
  ellipsoid(x, y, z, 2 + rand() * 1.8, 2 + rand() * 1.5,
            1.5 + rand() * 1.8, greens[1 + Math.floor(rand() * 3)]);
}

// Sunlit upper leaves and a little natural color variation.
const foliage = [];
forEach((x, y, z, color) => {
  if (greens.includes(color)) foliage.push([x, y, z]);
});
for (const [x, y, z] of foliage) {
  if (!get(x, y, z + 1) && rand() < 0.55)
    set(x, y, z, rand() < 0.7 ? greens[3] : greens[4]);
  else if (rand() < 0.045)
    set(x, y, z, greens[1 + Math.floor(rand() * 3)]);
}

// Roses face the viewer: overlapping outer petals, curled inner petals,
// and tiny dark creases make them readable even at a distance.
function rose(x, y, z) {
  line(24, 24, 15, x, y + 2, z - 2, 1, "#347c38");
  ellipsoid(x, y + 1, z - 3, 2, 2, 2, "#257137");
  ellipsoid(x - 3, y + 1, z - 2, 2, 1, 1, "#429b43");
  ellipsoid(x + 3, y + 1, z - 2, 2, 1, 1, "#429b43");

  sphere(x, y, z, 3, "#a91f35");
  ellipsoid(x - 3, y - 1, z, 2, 2, 3, "#d92e43");
  ellipsoid(x + 3, y - 1, z, 2, 2, 3, "#e23849");
  ellipsoid(x, y, z + 3, 3, 2, 2, "#eb4150");
  ellipsoid(x, y - 1, z - 3, 3, 2, 2, "#c8243d");

  ellipsoid(x, y - 3, z, 2, 1, 2, "#8d1931");
  ellipsoid(x - 1, y - 4, z + 1, 1, 1, 2, "#ef4a55");
  ellipsoid(x + 1, y - 4, z, 1, 1, 1, "#d52a42");
  set(x, y - 5, z, "#741a2c");
  set(x, y - 5, z + 1, "#f45a61");
}

rose(11, 15, 23);
rose(19, 12, 28);
rose(31, 13, 26);
rose(38, 23, 23);
rose(16, 30, 29);
rose(30, 32, 29);

// Two upright pink buds with green pointed sepals.
function bud(x, y, z) {
  line(24, 24, 16, x, y, z - 3, 1, "#35843d");
  ellipsoid(x, y, z, 2, 2, 3, "#cf668b");
  ellipsoid(x, y - 1, z + 1, 2, 1, 2, "#f58eaa");
  ellipsoid(x, y, z - 2, 2, 2, 1, "#348540");
  line(x - 2, y, z - 2, x - 1, y, z + 1, 0, "#45a04b");
  line(x + 2, y, z - 2, x + 1, y, z + 1, 0, "#45a04b");
  set(x, y - 1, z + 3, "#ffb0bd");
}
bud(8, 30, 25);
bud(39, 33, 27);