1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 20:57:10 +00:00

Panini projection

This commit is contained in:
Zeno Rogue
2020-11-01 21:20:54 +01:00
parent 2cc06e39ba
commit 6513b3a87e
6 changed files with 104 additions and 17 deletions

View File

@@ -22,6 +22,8 @@ EX bool spatial_graphics;
EX bool wmspatial, wmescher, wmplain, wmblack, wmascii, wmascii3;
EX bool mmspatial, mmhigh, mmmon, mmitem;
EX ld panini_alpha = 0;
EX int detaillevel = 0;
EX bool first_cell_to_draw = true;
@@ -4878,7 +4880,8 @@ EX void calcparam() {
cd->xcenter += cd->scrsize * pconf.xposition;
cd->ycenter += cd->scrsize * pconf.yposition;
cd->tanfov = tan(vid.fov * degree / 2);
ld fov = vid.fov * degree / 2;
cd->tanfov = sin(fov) / (cos(fov) + panini_alpha);
callhooks(hooks_calcparam);
reset_projection();