mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
3d:: applymodel now works correctly (to find onscreen coordinates)
This commit is contained in:
parent
8d83959229
commit
dd57f2733a
@ -6030,7 +6030,8 @@ void calcparam() {
|
||||
if(current_display->sidescreen) cd->xcenter = vid.yres/2;
|
||||
}
|
||||
|
||||
cd->radius = vid.scale * cd->scrsize;
|
||||
cd->radius = vid.scale * cd->scrsize;
|
||||
if(DIM == 3) cd->radius = cd->scrsize;
|
||||
realradius = min(realradius, cd->radius);
|
||||
|
||||
if(dronemode) { cd->ycenter -= cd->radius; cd->ycenter += vid.fsize/2; cd->ycenter += vid.fsize/2; cd->radius *= 2; }
|
||||
|
@ -234,8 +234,9 @@ hyperpoint mobius(hyperpoint h, ld angle, ld scale = 1) {
|
||||
void applymodel(hyperpoint H, hyperpoint& ret) {
|
||||
|
||||
if(DIM == 3) {
|
||||
ret[0] = H[0]/H[2];
|
||||
ret[1] = H[1]/H[2];
|
||||
ld ratio = vid.xres / current_display->tanfov / current_display->radius / 2;
|
||||
ret[0] = H[0]/H[2] * ratio;
|
||||
ret[1] = H[1]/H[2] * ratio;
|
||||
ret[2] = 1;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user