s2xe:: removed old junk
This commit is contained in:
parent
55c41463dd
commit
341934d1c5
37
drawing.cpp
37
drawing.cpp
|
@ -1096,42 +1096,6 @@ void draw_s2xe0(dqi_poly *p) {
|
|||
}
|
||||
|
||||
glcoords.resize(p->cnt);
|
||||
if(p->flags & POLY_TRIANGLES) {
|
||||
for(int i=0; i<p->cnt; i+=3) {
|
||||
int nbad = 0;
|
||||
for(int j=i; j<i+3; j++) {
|
||||
if(pd[j].bad >= 1) nbad = max(nbad, 0);
|
||||
if(pd[j].bad >= 2) nbad = 2;
|
||||
}
|
||||
|
||||
int g = (pd[i].distance > M_PI/2 || pd[i+1].distance >= M_PI/2 || pd[i+2].distance >= M_PI/2) ? 2 : 1;
|
||||
|
||||
auto c1 = crossdot(pd[i+0].direction, pd[i+1].direction);
|
||||
auto c2 = crossdot(pd[i+1].direction, pd[i+2].direction);
|
||||
auto c3 = crossdot(pd[i+2].direction, pd[i+0].direction);
|
||||
if(c1.second < 0 || c2.second < 0 || c3.second < 0) nbad = max(nbad, g);
|
||||
if(c1.first > 0 && c2.first > 0 && c3.first > 0) nbad = max(nbad, g);
|
||||
if(c1.first < 0 && c2.first < 0 && c3.first < 0) nbad = max(nbad, g);
|
||||
pd[i].bad = pd[i+1].bad = pd[i+2].bad = nbad;
|
||||
}
|
||||
|
||||
for(int gen=-maxgen; gen<=maxgen; gen++) {
|
||||
for(int i=0; i<p->cnt; i++) {
|
||||
auto& cur = pd[i];
|
||||
if(cur.bad >= (gen ? 1 : 2)) glcoords[i] = junk;
|
||||
else {
|
||||
hyperpoint h;
|
||||
ld d = cur.distance + 2 * M_PI * gen;
|
||||
h[0] = cur.direction[0] * d;
|
||||
h[1] = cur.direction[1] * d;
|
||||
h[2] = cur.z;
|
||||
glcoords[i] = glhr::pointtogl(h);
|
||||
}
|
||||
}
|
||||
npoly.gldraw();
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(auto c: pd) if(c.bad == 2) return;
|
||||
bool no_gens = false;
|
||||
for(int i=0; i<p->cnt; i++) {
|
||||
|
@ -1174,7 +1138,6 @@ void draw_s2xe0(dqi_poly *p) {
|
|||
npoly.gldraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
EX }
|
||||
|
||||
EX namespace ods {
|
||||
|
|
Loading…
Reference in New Issue