fogón

← Piratas y marObjeto 3Dfogon/barco-pirata

Barco pirata

de fogonCC015302 bloques
Barco pirataArrastrá para girarlo
// «Barco pirata» · gpt-6-sol (medium)
// A big chunky cartoon pirate galleon seen from the side-front, its long hull along y with the bow pointing to -y: dark warm brown planks with lighter plank lines, a raised stern castle at the back with small square windows glowing yellow, a row of three black cannon ports on each side, two masts with big black square sails showing a white skull, rope rigging lines, a crow's nest on the main mast and a small black skull flag on top. The hull sits on a thin flat band of turquoise water at z=0.

// A thin turquoise sea stays still while the galleon rocks above it.
box(2, 3, 0, 46, 45, 0, "#23bdb9");
for (let i = 0; i < 230; i++) {
  const x = 3 + Math.floor(rand() * 43);
  const y = 4 + Math.floor(rand() * 41);
  set(x, y, 0, rand() < 0.65 ? "#55d9cf" : "#168f9c");
}

part("casco", [24, 24, 0]);
animate("casco", { type: "swing", axis: "y", speed: 1.5, amplitude: 0.08 });

const dark = "#57301f", wood = "#794328", light = "#a96738";
const gold = "#edb849", black = "#171923", ivory = "#fff1ce";

function halfWidth(y) {
  if (y < 7) return 2 + (y - 5) * 2;
  if (y < 13) return 6 + (y - 7);
  if (y <= 36) return 12;
  return Math.max(3, 12 - (y - 36) * 1.3);
}
function edge(y, z) {
  const taper = z < 6 ? 0.48 + z * 0.065 : z < 10 ? 0.78 + (z - 6) * 0.055 : 1;
  return Math.max(1, Math.floor(halfWidth(y) * taper));
}

// Solid, rounded-bottom wooden hull, narrowing to a pointed bow.
for (let y = 5; y <= 42; y++) {
  for (let z = 2; z <= 14; z++) {
    const w = edge(y, z);
    for (let x = 24 - w; x <= 24 + w; x++) {
      const c = z < 6 ? dark : z > 11 ? light : wood;
      set(x, y, z, rand() < 0.045 ? (z < 7 ? wood : light) : c);
    }
    // Long, readable horizontal plank seams on both sides.
    if ([5, 8, 11, 14].includes(z)) {
      set(24 - w, y, z, z === 14 ? gold : "#bd7a43");
      set(24 + w, y, z, z === 14 ? gold : "#bd7a43");
    }
    if (y % 6 === 0 && z > 5 && z < 14) {
      set(24 - w, y, z, dark);
      set(24 + w, y, z, dark);
    }
  }
}

// Deck boards, high gunwales, and a golden bow flourish.
box(14, 13, 15, 34, 36, 15, "#b77a46");
for (let y = 13; y <= 38; y += 4) box(15, y, 15, 33, y, 15, "#d59a59");
for (let y = 10; y <= 39; y++) {
  const w = halfWidth(y);
  for (const side of [-1, 1]) {
    const x = 24 + side * Math.floor(w);
    box(x, y, 15, x, y, 17, wood);
    set(x, y, 17, gold);
  }
}
line(24, 6, 14, 24, 2, 19, 1, light);
line(24, 7, 16, 24, 2, 22, 0, gold);

// Three dark gunports and protruding cannons on EACH side.
for (const y of [16, 25, 33]) {
  for (const side of [-1, 1]) {
    const x = 24 + side * edge(y, 10);
    box(x, y - 2, 8, x, y + 2, 12, gold);
    box(x + side, y - 1, 9, x + side, y + 1, 11, black);
    box(x + side * 2, y, 10, x + side * 4, y, 11, "#343943");
    set(x + side * 4, y, 10, "#11151a");
  }
}

// Raised stern castle with square, glowing cabin windows.
box(13, 34, 16, 35, 41, 21, wood);
box(13, 34, 21, 35, 41, 22, light);
box(12, 34, 22, 36, 42, 23, dark);
box(12, 34, 23, 36, 42, 23, gold);
for (const x of [17, 24, 31]) {
  box(x - 2, 33, 18, x + 2, 33, 21, dark);
  box(x - 1, 32, 19, x + 1, 32, 20, "#ffdb69");
  set(x, 31, 19, "#fff2a2");
  set(x, 31, 20, dark);
}
for (const x of [13, 35]) {
  for (const y of [36, 40]) {
    box(x, y - 1, 18, x, y + 1, 20, dark);
    set(x + (x === 13 ? -1 : 1), y, 19, "#ffd265");
  }
}
for (let x = 12; x <= 36; x += 3) box(x, 35, 24, x, 35, 25, light);
box(12, 35, 25, 36, 35, 25, gold);

// Two sturdy masts and their broad, square black sails.
function sail(y, bottom, top, left, right, mastTop) {
  box(23, y, 16, 25, y + 1, mastTop, dark);
  box(left, y - 1, bottom, right, y, top, black);
  box(left, y - 1, top, right, y + 1, top, light);
  box(left - 1, y - 1, bottom, right + 1, y + 1, bottom, wood);
  for (let z = bottom + 2; z < top; z += 4) {
    set(left, y - 2, z, "#353642");
    set(right, y - 2, z, "#353642");
  }
}
sail(15, 22, 32, 15, 33, 38);
sail(28, 23, 36, 13, 35, 44);

// Big white skull on the main sail, facing the viewer at -y.
ellipsoid(24, 26, 31, 5, 0, 4, ivory);
box(21, 26, 26, 27, 26, 29, ivory);
box(20, 25, 31, 22, 25, 32, black);
box(26, 25, 31, 28, 25, 32, black);
set(24, 25, 29, black);
for (const x of [22, 24, 26]) set(x, 25, 26, black);

// A smaller skull on the foresail.
ellipsoid(24, 13, 28, 3, 0, 2, ivory);
box(22, 13, 25, 26, 13, 27, ivory);
set(23, 12, 28, black);
set(25, 12, 28, black);
set(24, 12, 26, black);

// Rope stays and side rigging.
for (const [y, top] of [[15, 37], [28, 42]]) {
  line(24, y, top, 24, 7, 17, 0, "#c99b65");
  line(24, y, top, 24, 40, 23, 0, "#c99b65");
  for (const side of [-1, 1]) {
    line(24, y, top - 2, 24 + side * 12, y + 3, 16, 0, "#a98258");
  }
}

// Crow's nest above the main sail.
box(20, 25, 38, 28, 31, 38, wood);
for (let x = 20; x <= 28; x++) {
  for (const y of [25, 31]) {
    set(x, y, 39, light);
    set(x, y, 40, gold);
  }
}
for (let y = 25; y <= 31; y++) {
  for (const x of [20, 28]) {
    set(x, y, 39, light);
    set(x, y, 40, gold);
  }
}

// The little pirate flag swings independently at the masthead.
part("flag", [24, 28, 44]);
animate("flag", { type: "swing", axis: "z", speed: 4, amplitude: 0.3 });
box(24, 28, 42, 34, 28, 46, black);
box(27, 27, 44, 30, 27, 45, ivory);
set(28, 26, 45, black);
set(30, 26, 45, black);
box(28, 27, 43, 29, 27, 43, ivory);
line(26, 27, 42, 32, 27, 46, 0, ivory);
line(26, 27, 46, 32, 27, 42, 0, ivory);