diff --git a/3d-models.cpp b/3d-models.cpp index a888f1ad..ca149a15 100644 --- a/3d-models.cpp +++ b/3d-models.cpp @@ -674,6 +674,18 @@ void geometry_information::make_star(hpcshape& sh, ld rad) { } } +void geometry_information::make_euclidean_sky() { + bshape(cgi.shEuclideanSky, PPR::EUCLIDEAN_SKY); + for(int x=-20; x<20; x++) + for(int y=-20; y<20; y++) + hpcsquare( + zpush(cgi.WALL) * hpxy(x, y), + zpush(cgi.WALL) * hpxy(x, y+1), + zpush(cgi.WALL) * hpxy(x+1, y), + zpush(cgi.WALL) * hpxy(x+1, y+1) + ); + } + hyperpoint psmin(hyperpoint H) { hyperpoint res; res[2] = asin_auto(H[2]); @@ -1007,8 +1019,10 @@ void geometry_information::make_3d_models() { make_ball(shDisk, orbsize*.2, 2); make_ball(shHeptaMarker, zhexf*.2, 1); make_ball(shSnowball, zhexf*.1, 0); - if(euclid) + if(euclid) { make_ball(shSun, 0.5, 2); + make_euclidean_sky(); + } else make_star(shSun, 3); make_star(shNightStar, 0.75); diff --git a/graph.cpp b/graph.cpp index bbe9ae23..f847ec66 100644 --- a/graph.cpp +++ b/graph.cpp @@ -4622,17 +4622,7 @@ void draw_euclidean_sky() { if(WDIM == 3 || GDIM == 2) return; transmatrix T = ggmatrix(currentmap->gamestart()); T = gpushxto0(tC0(T)) * T; - for(int x=-20; x<20; x++) - for(int y=-20; y<20; y++) { - curvepoint(T * zpush(cgi.WALL) * hpxy(x, y)); - curvepoint(T * zpush(cgi.WALL) * hpxy(x, y+1)); - curvepoint(T * zpush(cgi.WALL) * hpxy(x+1, y)); - curvepoint(T * zpush(cgi.WALL) * hpxy(x+1, y+1)); - curvepoint(T * zpush(cgi.WALL) * hpxy(x, y+1)); - curvepoint(T * zpush(cgi.WALL) * hpxy(x+1, y)); - } - queuecurve(0, 0x0044e4FF, PPR::EUCLIDEAN_SKY).flags |= POLY_TRIANGLES; - + queuepoly(T, cgi.shEuclideanSky, 0x0044e4FF); queuepolyat(T * zpush(cgi.SKY+0.5) * xpush(cgi.SKY+0.5), cgi.shSun, 0xFFFF00FF, PPR::SKY); } diff --git a/hyper.h b/hyper.h index 757c9006..62c1b23a 100644 --- a/hyper.h +++ b/hyper.h @@ -4374,7 +4374,7 @@ hpcshape shKnife, shTongue, shFlailMissile, shTrapArrow, shPirateHook, shPirateHood, shEyepatch, shPirateX, // shScratch, - shHeptaMarker, shSnowball, shSun, shNightStar, + shHeptaMarker, shSnowball, shSun, shNightStar, shEuclideanSky, shSkeletonBody, shSkull, shSkullEyes, shFatBody, shWaterElemental, shPalaceGate, shFishTail, shMouse, shMouseLegs, shMouseEyes, @@ -4524,6 +4524,7 @@ hpcshape void balltriangle(hyperpoint a, hyperpoint b, hyperpoint c, ld rad, int lev); void make_ball(hpcshape& sh, ld rad, int lev); void make_star(hpcshape& sh, ld rad); + void make_euclidean_sky(); void adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye, ld shift_head, int q, ld zoom=1); void shift_last_straight(ld z); void queueball(const transmatrix& V, ld rad, color_t col, eItem what);