1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-04-27 05:03:15 +00:00

added a noniso honeycomb viz to the presentation, and noniso slides are now in a common folder

This commit is contained in:
Zeno Rogue 2020-08-10 18:09:19 +02:00
parent b0d34adf32
commit 38a5b4d1f8
7 changed files with 165 additions and 8 deletions

View File

@ -4091,3 +4091,8 @@ Geometries:
2020-08-05 01:29 Update 11.3w: 2020-08-05 01:29 Update 11.3w:
- fixed shmup in elliptic - fixed shmup in elliptic
- fixed a crash with loading old save games - fixed a crash with loading old save games
2020-08-08 16:10 Update 11.3x:
- fixed raycaster in twisted geometries; weirdly twisted spherical geometry
- draw crosshair even if nohud
- an attempt to fix/debug the crash that some people are reporting on loading a saved game

View File

@ -13,8 +13,8 @@
#define _HYPER_H_ #define _HYPER_H_
// version numbers // version numbers
#define VER "11.3w" #define VER "11.3x"
#define VERNUM_HEX 0xA837 #define VERNUM_HEX 0xA838
#include "sysconfig.h" #include "sysconfig.h"

View File

@ -293,7 +293,7 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
+ addHook(rvtour::hooks_build_rvtour, 152, [] (vector<tour::slide>& v) { + addHook(rvtour::hooks_build_rvtour, 152, [] (vector<tour::slide>& v) {
using namespace tour; using namespace tour;
v.push_back( v.push_back(
tour::slide{"Impossible architecture in Nil/impossible ring", 18, LEGAL::NONE | QUICKGEO, tour::slide{"non-isotropic geometries/Impossible architecture in Nil/impossible ring", 18, LEGAL::NONE | QUICKGEO,
"Ring with a square cross-section. Cut it in half. Rotate one of the two halves by 90°, " "Ring with a square cross-section. Cut it in half. Rotate one of the two halves by 90°, "
"keeping one of the two ends connected to the other half. Do this in Nil geometry, so the other pair of ends remains connected too.\n\n" "keeping one of the two ends connected to the other half. Do this in Nil geometry, so the other pair of ends remains connected too.\n\n"
"Move with mouse/arrows/PgUpDn. Press '5' to enable animation, 'o' to change ring size.\n\n", "Move with mouse/arrows/PgUpDn. Press '5' to enable animation, 'o' to change ring size.\n\n",

View File

@ -0,0 +1,151 @@
#include "rogueviz.h"
namespace rogueviz {
namespace honey {
bool alone = true;
bool in_special = false;
auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
using namespace tour;
return [=] (presmode mode) {
if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(smooth_scrolling, true);
stop_game();
set_geometry(g);
if(g == gSphere) {
set_geometry(gProduct);
}
if(g == gNormal) {
set_geometry(gRotSpace);
}
tour::slide_backup<ld>(sightranges[gProduct], 12);
tour::slide_backup<ld>(sightranges[gNil], 7);
tour::slide_backup<ld>(sightranges[gSol], 7);
tour::slide_backup<ld>(sightranges[gSpace435], 7);
vid.texture_step = 4;
firstland = specialland = laCanvas;
tour::slide_backup(patterns::jhole, jhole);
tour::slide_backup(patterns::rwalls, jhole);
tour::slide_backup(patterns::jblock, jblock);
tour::slide_backup(patterns::whichCanvas, canvas);
tour::slide_backup(vid.linewidth, vid.linewidth / 10);
start_game();
if(jblock < 0) {
pmodel = mdDisk;
sightranges[gSol] = 4;
}
}
if(mode == pmStop && jblock < 0)
pmodel = mdGeodesic;
slidecommand = "switch raycaster";
if(in_special && among(mode, pmGeometrySpecial, pmStop)) {
in_special = false;
gamestack::pop();
patterns::whichCanvas = canvas;
vid.grid = false;
fat_edges = false;
sightranges[gSpace435] = 7;
}
else if(mode == pmGeometrySpecial && !in_special) {
in_special = true;
gamestack::push();
patterns::whichCanvas = 'g';
vid.grid = true;
stdgridcolor = 0xFFFF00FF;
fat_edges = true;
start_game();
sightranges[gSpace435] = 3;
}
if(mode == pmKey && jblock < 0) {
sightranges[gSol] = 11 - sightranges[gSol];
addMessage("Changed the sight range to ", sightranges[gSol]);
}
else if(mode == pmKey) {
if(sl2) {
addMessage("Raycaster not implemented here.");
}
else if(ray::want_use != 2) {
ray::want_use = 2;
ray::max_cells = 4096;
addMessage("Using a raycaster.");
}
else {
ray::want_use = 0;
addMessage("Using primitives.");
}
}
};
}
string cap = "non-isotropic geometries/honeycombs/";
void honey(vector<tour::slide>& v) {
using namespace tour;
v.emplace_back(
slide{cap+"Tessellations in 3D geometries", 999, LEGAL::NONE | QUICKSKIP,
"This series of slides presents the honeycombs we use. "
"You can compare the output of primitive-based and raycaster-based rendering by pressing '5'.",
[] (presmode mode) {}
});
v.emplace_back(
slide{cap+"Hyperbolic space", 999, LEGAL::SPECIAL,
"Traditional visualizations of non-Euclidean honeycombs "
"show the edges of all cells. In our visualizations, we fill some of the cells. "
"The disadvantage of the traditional visualization is visible here, on the example of {4,3,5} hyperbolic honeycomb: "
"our Euclidean brains tend to interpret this visualization incorrectly. (Press '2' to get the traditional visualization.)",
geoslide(gSpace435, 'r', 50, 0)
});
v.emplace_back(
slide{cap+"S2xE", 999, LEGAL::NONE,
"This is the S2xE geometry.",
geoslide(gSphere, 'r', 10, 0)
});
v.emplace_back(
slide{cap+"Solv: random", 999, LEGAL::NONE,
"Random blocks in Solv geometry.",
geoslide(gSol, 'r', 20, 0)
});
v.emplace_back(
slide{cap+"Solv: Poincaré ball", 999, LEGAL::NONE,
"Surfaces of constant 'z' in Solv geometry, displayed in Poincaré ball-like model. "
"Press '5' to change the sight range (this slide is not optimized, so it will be slow).",
geoslide(gSol, 'j', 0, -1)
});
v.emplace_back(
slide{cap+"Solv: horotori", 999, LEGAL::NONE,
"Solv geometry. Colored torus-like surfaces are surfaces of constant 'z'. "
"Press '5' to enable the raycaster",
geoslide(gSol, 'j', 50, 0)
});
v.emplace_back(
slide{cap+"Solv: difficult region", 999, LEGAL::NONE,
"This slide focuses on the area in Solv geometry which is difficult to render using primitives. "
"Press '5' to enable the raycaster.",
geoslide(gSol, 'J', 0, 10)
});
v.emplace_back(
slide{cap+"Nil geometry", 999, LEGAL::NONE,
"Nil geometry. Colored surfaces are surfaces of constant 'x'. "
"Press '5' to enable the raycaster",
geoslide(gNil, 'j', 10, 10)
});
v.emplace_back(
slide{cap+"SL(2,R) geometry", 999, LEGAL::NONE,
"SL(2,R) geometry.",
geoslide(gNormal, 'G', 90, 0)
});
}
auto hooks = addHook(rvtour::hooks_build_rvtour, 147, honey);
} }

View File

@ -24,3 +24,4 @@
#include "impossible-ring.cpp" #include "impossible-ring.cpp"
#include "triangle.cpp" #include "triangle.cpp"
#include "sumotron.cpp" #include "sumotron.cpp"
#include "noniso-honeycombs.cpp"

View File

@ -140,7 +140,7 @@ bool draw_snow(cell *c, const shiftmatrix& V) {
bool cylanim = false; bool cylanim = false;
string cap = "non-Euclidean snowballs/"; string cap = "non-isotropic geometries/non-Euclidean snowballs/";
void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t) { void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t) {
using namespace tour; using namespace tour;

View File

@ -524,6 +524,7 @@ void slide_itri(tour::presmode mode, int id) {
} }
} }
string cap = "non-isotropic geometries/Impossible architecture in Nil/";
auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle) auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
@ -546,12 +547,11 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
return 0; return 0;
}) })
+ addHook(rvtour::hooks_build_rvtour, 151, [] (vector<tour::slide>& v) { + addHook(rvtour::hooks_build_rvtour, 151, [] (vector<tour::slide>& v) {
using namespace tour; using namespace tour;
v.push_back( v.push_back(
tour::slide{"Impossible architecture in Nil/impossible triangle", 18, LEGAL::NONE | QUICKGEO, tour::slide{cap+"impossible triangle", 18, LEGAL::NONE | QUICKGEO,
"This form of impossible triangle was first created by Oscar Reutersvärd. " "This form of impossible triangle was first created by Oscar Reutersvärd. "
"It was later independently discovered by Lionel Penrose and Roger Penrose, and popularized by M. C. Escher.\n\n" "It was later independently discovered by Lionel Penrose and Roger Penrose, and popularized by M. C. Escher.\n\n"
"Move with mouse/arrows/PgUpDn. Press '5' to enable animation, 'o' to change ring size.", "Move with mouse/arrows/PgUpDn. Press '5' to enable animation, 'o' to change ring size.",
@ -562,7 +562,7 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
}}); }});
v.push_back( v.push_back(
tour::slide{"Impossible architecture in Nil/impossible triangle chainmail", 18, LEGAL::NONE | QUICKGEO, tour::slide{cap+"impossible triangle chainmail", 18, LEGAL::NONE | QUICKGEO,
"Here we try to link the impossible triangles into a construction reminiscent of a chainmail.", "Here we try to link the impossible triangles into a construction reminiscent of a chainmail.",
[] (presmode mode) { [] (presmode mode) {
@ -571,7 +571,7 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
}}); }});
v.push_back( v.push_back(
tour::slide{"Impossible architecture in Nil/impossible triangle network", 18, LEGAL::NONE | QUICKGEO, tour::slide{cap+"impossible triangle network", 18, LEGAL::NONE | QUICKGEO,
"It is not possible to reconstruct Escher's Waterfall in Nil geometry, because one of the three triangles there " "It is not possible to reconstruct Escher's Waterfall in Nil geometry, because one of the three triangles there "
"has opposite orientation. For this reason, that one triangle would not connect correctly. Penrose triangles " "has opposite orientation. For this reason, that one triangle would not connect correctly. Penrose triangles "
"in Nil would not create a planar structure, but rather a three-dimensional one. This slide shows the picture. " "in Nil would not create a planar structure, but rather a three-dimensional one. This slide shows the picture. "