chasmifyPoly now uses logical coordinates

This commit is contained in:
Zeno Rogue 2023-01-29 17:03:25 +01:00
parent 40ad4f04d2
commit b11e270eb5
1 changed files with 4 additions and 4 deletions

View File

@ -101,7 +101,7 @@ void geometry_information::chasmifyPoly(double fol, double fol2, int k) {
} }
else { else {
vector<hyperpoint> points; vector<hyperpoint> points;
for(int s = last->s; s<isize(hpc); s++) points.push_back(hpc[s]); for(int s = last->s; s<isize(hpc); s++) points.push_back(cgi.emb->actual_to_logical( hpc[s] ));
hpc.resize(last->s); hpc.resize(last->s);
last->flags |= POLY_TRIANGLES; last->flags |= POLY_TRIANGLES;
last->texture_offset = 0; last->texture_offset = 0;
@ -112,9 +112,9 @@ void geometry_information::chasmifyPoly(double fol, double fol2, int k) {
if(zf == isize(points)-1) zf--; if(zf == isize(points)-1) zf--;
x -= zf; x -= zf;
auto hp = points[zf] + (points[zf+1] - points[zf]) * x; auto hp = points[zf] + (points[zf+1] - points[zf]) * x;
auto hf = cgi.emb->normalize_flat(hp); hp[2] = fol + (fol2-fol) * y;
auto ho = orthogonal_move(hf, fol + (fol2-fol) * y); auto hf = cgi.emb->logical_to_actual(hp);
hpcpush(ho); hpcpush(hf);
}; };
texture_order([&] (ld x, ld y) { at((1-x+y)/2, (1-x-y)/2); }); texture_order([&] (ld x, ld y) { at((1-x+y)/2, (1-x-y)/2); });
texture_order([&] (ld x, ld y) { at((1-x-y)/2, (1+x-y)/2); }); texture_order([&] (ld x, ld y) { at((1-x-y)/2, (1+x-y)/2); });