1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-16 13:48:04 +00:00

fisheye model

This commit is contained in:
Zeno Rogue
2018-04-18 20:52:17 +02:00
parent 14a4375cf0
commit f1bcd91de5
4 changed files with 22 additions and 4 deletions

View File

@@ -222,6 +222,16 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
return;
}
if(pmodel == mdFisheye) {
ret[0] = H[0] / tz;
ret[1] = H[1] / tz;
ld hypot = sqrt(1 + ret[0]*ret[0] + ret[1]*ret[1]);
ret[0] /= hypot;
ret[1] /= hypot;
ghcheck(ret, H);
return;
}
ld zlev = 1;
bool zlev_used = false;