1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-28 05:21:18 +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

@@ -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;
}