1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 15:39:54 +00:00

3d:: applymodel now works correctly (to find onscreen coordinates)

This commit is contained in:
? 2019-02-28 19:00:32 +01:00 committed by Zeno Rogue
parent 8d83959229
commit dd57f2733a
2 changed files with 5 additions and 3 deletions

View File

@ -6031,6 +6031,7 @@ void calcparam() {
} }
cd->radius = vid.scale * cd->scrsize; cd->radius = vid.scale * cd->scrsize;
if(DIM == 3) cd->radius = cd->scrsize;
realradius = min(realradius, cd->radius); realradius = min(realradius, cd->radius);
if(dronemode) { cd->ycenter -= cd->radius; cd->ycenter += vid.fsize/2; cd->ycenter += vid.fsize/2; cd->radius *= 2; } if(dronemode) { cd->ycenter -= cd->radius; cd->ycenter += vid.fsize/2; cd->ycenter += vid.fsize/2; cd->radius *= 2; }

View File

@ -234,8 +234,9 @@ hyperpoint mobius(hyperpoint h, ld angle, ld scale = 1) {
void applymodel(hyperpoint H, hyperpoint& ret) { void applymodel(hyperpoint H, hyperpoint& ret) {
if(DIM == 3) { if(DIM == 3) {
ret[0] = H[0]/H[2]; ld ratio = vid.xres / current_display->tanfov / current_display->radius / 2;
ret[1] = H[1]/H[2]; ret[0] = H[0]/H[2] * ratio;
ret[1] = H[1]/H[2] * ratio;
ret[2] = 1; ret[2] = 1;
return; return;
} }