1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-06-11 15:22:11 +00:00

3D effects in the new models. Also made the 3D effects in old models 'correct'

This commit is contained in:
Zeno Rogue
2018-03-27 04:01:30 +02:00
parent 7c84280b73
commit fa7822fdf8
4 changed files with 136 additions and 63 deletions
+13 -5
View File
@@ -589,12 +589,20 @@ void drawpolyline(polytodraw& p) {
}
if(mdAzimuthalEqui() && (poly_flags & POLY_INVERSE)) {
ld h = atan2(glcoords[0][0], glcoords[0][1]);
for(int i=0; i<=360; i++) {
ld a = i * M_PI / 180 + h;
glcoords.push_back(make_array<GLfloat>(vid.radius * sin(a), vid.radius * cos(a), stereo::scrdist));
if(abs(zlevel(pp.V * C0) - 1) < 1e-6) {
// we should fill the other side
ld h = atan2(glcoords[0][0], glcoords[0][1]);
for(int i=0; i<=360; i++) {
ld a = i * M_PI / 180 + h;
glcoords.push_back(make_array<GLfloat>(vid.radius * sin(a), vid.radius * cos(a), stereo::scrdist));
}
poly_flags ^= POLY_INVERSE;
}
else {
// If we are on a zlevel, the algorithm above will not work correctly.
// It is hard to tell what to do in this case. Just fill neither side
p.col = 0;
}
poly_flags ^= POLY_INVERSE;
}
#if CAP_GL