1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

lower halfplane model added

This commit is contained in:
Zeno Rogue 2018-03-25 15:27:42 +02:00
parent a10491f3d6
commit 9af2566e5f
5 changed files with 17 additions and 16 deletions

View File

@ -294,6 +294,7 @@ void initConfig() {
addsaver(conformal::bandsegment, "band segment");
addsaver(conformal::rotation, "conformal rotation");
addsaver(conformal::do_rotate, "conformal rotation mode", 1);
addsaver(conformal::lower_halfplane, "lower halfplane", false);
addsaver(conformal::autoband, "automatic band");
addsaver(conformal::autobandhistory, "automatic band history");
addsaver(conformal::dospiral, "do spiral");

View File

@ -274,6 +274,7 @@ namespace conformal {
int bandsegment = 16000;
ld rotation = 0;
int do_rotate = 1;
bool lower_halfplane;
bool autoband = false;
bool autobandhistory = false;
bool dospiral = true;
@ -529,19 +530,6 @@ namespace conformal {
}
#endif
const char* directions[MODELCOUNT][4] = {
{ "right", "up", "left", "down" },
{ "counterclockwise", "zoom out", "clockwise", "zoom in" },
{ "left to right", "spin down", "right to left", "spin up" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" },
{ "right", "up", "left", "down" }
};
const char *modelnames[MODELCOUNT] = {
"disk", "half-plane", "band", "polygonal", "polynomial",
"azimuthal equidistant", "azimuthal equi-area",
@ -607,6 +595,9 @@ namespace conformal {
dialog::addSelItem(XLAT("which coefficient"), its(polygonal::coefid), 'n');
}
if(pmodel == mdHalfplane)
dialog::addBoolItem(XLAT("lower half-plane"), lower_halfplane, 'l');
if(pmodel == mdBall)
dialog::addSelItem(XLAT("projection in ball model"), fts3(vid.ballproj), 'x');
@ -652,6 +643,8 @@ namespace conformal {
config_camera_rotation();
else if(uni == 'u')
pushScreen(rug::show);
else if(uni == 'l' && pmodel == mdHalfplane)
lower_halfplane = !lower_halfplane;
else if(uni == 'a')
pushScreen(history_menu);
else if(uni == 'l') {

View File

@ -899,6 +899,7 @@ namespace conformal {
extern bool includeHistory;
extern ld rotation;
extern int do_rotate;
extern bool lower_halfplane;
extern bool autoband;
extern bool autobandhistory;
extern bool dospiral;

View File

@ -241,16 +241,22 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
ld x0, y0;
x0 = H[0] / tz;
y0 = H[1] / tz;
if(conformal::lower_halfplane) x0 = -x0, y0 = -y0;
y0 += 1;
double rad = x0*x0 + y0*y0;
y0 /= rad;
x0 /= rad;
y0 -= .5;
if(conformal::lower_halfplane) x0 = -x0, y0 = -y0;
if(pmodel == mdHalfplane) {
ret[0] = x0;
if(wmspatial || mmspatial) y0 *= zlev;
ret[1] = 1 - y0;
if(wmspatial || mmspatial) {
if(conformal::lower_halfplane) y0 /= zlev;
else y0 *= zlev;
}
ret[1] = (conformal::lower_halfplane?-1:1) - y0;
ret[2] = 0;
if(zlev != 1 && stereo::active())
apply_depth(ret, -y0 * geom3::factor_to_lev(zlev));

View File

@ -306,7 +306,7 @@ void showMainMenu() {
void editScale() {
dialog::editNumber(vid.scale, .001, 1000, .1, 1, XLAT("scale factor"),
XLAT("Scale the displayed model."));
dialog::scaleLog();
dialog::scaleSinh();
}
void showDisplayMode() {