mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
3d:: clipping without OpenGL
This commit is contained in:
parent
f8fe631eca
commit
8ea5a618ad
@ -248,13 +248,20 @@ void display_data::set_projection(int ed, bool apply_models) {
|
||||
auto cd = current_display;
|
||||
|
||||
if(!shaderside_projection) {
|
||||
glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, abs(current_display->scrdist) + 30000));
|
||||
if(ed) {
|
||||
glhr::glmatrix m = glhr::id;
|
||||
m[2][0] -= ed;
|
||||
glhr::projection_multiply(m);
|
||||
if(DIM == 3 && apply_models) {
|
||||
glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, 1));
|
||||
glhr::id_modelview();
|
||||
current_display->scrdist_text = 0;
|
||||
}
|
||||
else {
|
||||
glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, abs(current_display->scrdist) + 30000));
|
||||
if(ed) {
|
||||
glhr::glmatrix m = glhr::id;
|
||||
m[2][0] -= ed;
|
||||
glhr::projection_multiply(m);
|
||||
}
|
||||
glhr::id_modelview();
|
||||
}
|
||||
glhr::id_modelview();
|
||||
}
|
||||
else {
|
||||
|
||||
|
11
polygons.cpp
11
polygons.cpp
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user