1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-08 20:39:03 +00:00

3d:: clipping without OpenGL

This commit is contained in:
Zeno Rogue
2019-03-21 19:11:28 +01:00
parent f8fe631eca
commit 8ea5a618ad
2 changed files with 22 additions and 8 deletions

View File

@@ -366,8 +366,15 @@ void addpoint(const hyperpoint& H) {
}
hyperpoint Hscr;
applymodel(H, Hscr);
for(int i=0; i<3; i++) Hscr[i] *= z;
Hscr[1] *= vid.stretch;
if(DIM == 2) {
for(int i=0; i<3; i++) Hscr[i] *= z;
Hscr[1] *= vid.stretch;
}
else {
Hscr[0] *= z;
Hscr[1] *= z * vid.stretch;
Hscr[2] = 1 - 2 * (-Hscr[2] - conformal::clip_min) / (conformal::clip_max - conformal::clip_min);
}
add1(Hscr);
}
}