fogón

← FantasíaObjeto 3Dfogon/cueva-del-dragon

Cueva del dragón

de fogonCC021923 bloques
Cueva del dragónArrastrá para girarlo
// «Cueva del dragón» · gpt-6-sol (medium)
// A rocky cave mouth facing front (-y): big dark grey boulders forming an arch with moss on top, a dark interior, and a big pile of gold coins, gems and a goblet spilling out of the entrance onto the ground, with a few scorch marks and bones near the opening.

const stone = ["#343b3e", "#41494b", "#50595a", "#606967", "#727a75"];
const gold = ["#9e651e", "#c78926", "#e9aa32", "#ffd257", "#ffe48b"];

function roundedRock(cx, cy, cz, rx, ry, rz) {
  for (let x = Math.floor(cx - rx); x <= cx + rx; x++)
    for (let y = Math.floor(cy - ry); y <= cy + ry; y++)
      for (let z = Math.max(0, Math.floor(cz - rz)); z <= cz + rz; z++) {
        const d = ((x-cx)/rx)**2 + ((y-cy)/ry)**2 + ((z-cz)/rz)**2;
        if (d > 1 + (rand()-.5)*.11) continue;
        let shade = z > cz + rz*.35 ? 3 : z < cz-rz*.4 ? 0 : 1;
        if (y < cy-ry*.3) shade++;
        if (rand() < .22) shade += rand() < .5 ? -1 : 1;
        set(x,y,z,stone[Math.max(0,Math.min(4,shade))]);
      }
}

// Uneven stone ground.
ellipsoid(24,25,0,20,17,2,"#444c49");
for (let i=0;i<380;i++) {
  const x=6+Math.floor(rand()*37), y=9+Math.floor(rand()*34);
  if (get(x,y,1)) set(x,y,2,rand()<.5?"#59615a":"#383f3e");
}

// Solid hillside, with a broad arched tunnel carved toward the back.
roundedRock(24,29,12,19,14,21);
for (let x=13;x<=35;x++)
  for (let y=10;y<=33;y++)
    for (let z=3;z<=27;z++) {
      const dx=Math.abs(x-24);
      const roof=25-.105*dx*dx;
      if (dx<=10 && z<roof && get(x,y,z)) set(x,y,z,null);
    }

// Shadowed rear wall and floor inside the cave.
for (let x=15;x<=33;x++)
  for (let z=3;z<=22;z++)
    if (get(x,34,z)) set(x,33,z,rand()<.82?"#181d25":"#252c32");
box(16,22,2,32,34,3,"#262b2b");
for (let i=0;i<95;i++) {
  const x=16+Math.floor(rand()*17), y=22+Math.floor(rand()*12);
  set(x,y,3,rand()<.7?"#343a37":"#474b43");
}

// Individual, rounded arch stones overlap the hillside.
roundedRock(10,20,8,5,5,8);
roundedRock(11,19,18,5,5,8);
roundedRock(15,19,26,5,5,5);
roundedRock(23,19,29,7,5,5);
roundedRock(32,19,26,5,5,5);
roundedRock(37,20,18,5,5,8);
roundedRock(38,20,8,5,5,8);

// Moss follows exposed upper surfaces.
const moss=[];
forEach((x,y,z,c)=>{
  if (z>15 && y<37 && stone.includes(c) && !get(x,y,z+1) && rand()<.43)
    moss.push([x,y,z+1]);
});
for (const [x,y,z] of moss)
  set(x,y,z,rand()<.28?"#8a9853":rand()<.55?"#536f45":"#647f4a");
for (let i=0;i<40;i++) {
  const x=8+Math.floor(rand()*33), y=15+Math.floor(rand()*24);
  for (let z=34;z>=15;z--) {
    if (get(x,y,z) && !get(x,y,z+1)) {
      if (rand()<.35) set(x,y,z+1,"#a0ad61");
      break;
    }
  }
}

// Deep, irregular heaps of treasure, highest inside the entrance.
ellipsoid(22,27,6,9,7,6,"#b87822");
ellipsoid(28,22,5,8,8,5,"#d49327");
ellipsoid(23,16,3,10,7,3,"#d3972d");
ellipsoid(19,12,2,6,4,2,"#b87822");
forEach((x,y,z,c)=>{
  if (c==="#b87822" || c==="#d49327" || c==="#d3972d")
    if (rand()<.31) set(x,y,z,gold[1+Math.floor(rand()*4)]);
});

// Little overlapping coin faces and bright rims.
for (let i=0;i<155;i++) {
  const x=15+Math.floor(rand()*20), y=10+Math.floor(rand()*24);
  for (let z=14;z>=2;z--) {
    const c=get(x,y,z);
    if (gold.includes(c) || c==="#d3972d" || c==="#d49327" || c==="#b87822") {
      if (!get(x,y,z+1) || rand()<.28) {
        cylinder(x,y,z+1,rand()<.25?2:1,1,rand()<.38?"#ffe48b":"#f7bd40");
        if (rand()<.55) set(x,y-1,z+1,"#a96920");
      }
      break;
    }
  }
}

// Large, jewel-like gems stand proud of the coins.
function gem(x,y,z,base,light,glint) {
  set(x,y,z,base); set(x-1,y,z+1,base); set(x+1,y,z+1,base);
  set(x,y-1,z+1,light); set(x,y,z+1,light);
  set(x-1,y,z+2,base); set(x,y,z+2,light);
  set(x+1,y,z+2,light); set(x,y,z+3,glint);
  set(x,y-1,z+2,glint);
}
gem(18,16,6,"#51317e","#a252e5","#efd0ff");
gem(29,25,10,"#176a72","#35d7d1","#bafff5");
gem(25,14,6,"#743554","#f054a3","#ffd1ef");
gem(33,19,5,"#2a7655","#64e89d","#d4ffe0");
gem(15,22,7,"#154d77","#42acee","#c0f5ff");

// Brass goblet, standing amid the spilled treasure.
cylinder(31,11,3,3,1,"#ae742c");
cylinder(31,11,4,2,1,"#f5c459");
cylinder(31,11,5,1,4,"#c18a32");
ellipsoid(31,11,10,3,3,3,"#b77b2a");
ellipsoid(31,10,11,3,3,2,"#efb743");
cylinder(31,11,12,3,1,"#ffe082");
cylinder(31,11,13,2,1,"#65416d");
set(31,10,14,"#e97fdf");
set(30,10,14,"#82fff0");
set(32,11,14,"#b656e6");
set(29,10,11,"#fff0a5");

// A couple of little mushrooms tucked into mossy rocks.
function mushroom(x,y,z) {
  cylinder(x,y,z,1,3,"#dfd5ac");
  ellipsoid(x,y,z+3,3,2,1,"#aa5180");
  set(x-1,y-1,z+4,"#ffd7e2");
  set(x+1,y,z+4,"#ffd7e2");
}
mushroom(9,16,17);
mushroom(36,17,25);

// Old scorch marks, with a few surviving orange embers.
for (const [cx,cy] of [[10,12],[39,13]]) {
  for (let i=0;i<35;i++) {
    const x=cx+Math.floor((rand()-.5)*8);
    const y=cy+Math.floor((rand()-.5)*6);
    const z=get(x,y,2)?3:2;
    set(x,y,z,rand()<.18?"#86513a":"#25292a");
  }
  set(cx,cy,3,"#e77d39");
  set(cx+2,cy-1,3,"#ad522c");
}

// Two scattered, cartoonishly chunky bones by the opening.
function bone(x,y,z,dx,dy) {
  line(x,y,z,x+dx,y+dy,z,0,"#e9dfba");
  sphere(x,y,z,1,"#f4e9c9");
  sphere(x+dx,y+dy,z,1,"#e8d9ad");
  set(x,y-1,z,"#fff0d1");
  set(x+dx,y+dy-1,z,"#f8edcd");
}
bone(12,11,3,5,1);
bone(37,11,3,-4,2);