mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
lower halfplane model added
This commit is contained in:
parent
a10491f3d6
commit
9af2566e5f
@ -294,6 +294,7 @@ void initConfig() {
|
|||||||
addsaver(conformal::bandsegment, "band segment");
|
addsaver(conformal::bandsegment, "band segment");
|
||||||
addsaver(conformal::rotation, "conformal rotation");
|
addsaver(conformal::rotation, "conformal rotation");
|
||||||
addsaver(conformal::do_rotate, "conformal rotation mode", 1);
|
addsaver(conformal::do_rotate, "conformal rotation mode", 1);
|
||||||
|
addsaver(conformal::lower_halfplane, "lower halfplane", false);
|
||||||
addsaver(conformal::autoband, "automatic band");
|
addsaver(conformal::autoband, "automatic band");
|
||||||
addsaver(conformal::autobandhistory, "automatic band history");
|
addsaver(conformal::autobandhistory, "automatic band history");
|
||||||
addsaver(conformal::dospiral, "do spiral");
|
addsaver(conformal::dospiral, "do spiral");
|
||||||
|
@ -274,6 +274,7 @@ namespace conformal {
|
|||||||
int bandsegment = 16000;
|
int bandsegment = 16000;
|
||||||
ld rotation = 0;
|
ld rotation = 0;
|
||||||
int do_rotate = 1;
|
int do_rotate = 1;
|
||||||
|
bool lower_halfplane;
|
||||||
bool autoband = false;
|
bool autoband = false;
|
||||||
bool autobandhistory = false;
|
bool autobandhistory = false;
|
||||||
bool dospiral = true;
|
bool dospiral = true;
|
||||||
@ -529,19 +530,6 @@ namespace conformal {
|
|||||||
}
|
}
|
||||||
#endif
|
#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] = {
|
const char *modelnames[MODELCOUNT] = {
|
||||||
"disk", "half-plane", "band", "polygonal", "polynomial",
|
"disk", "half-plane", "band", "polygonal", "polynomial",
|
||||||
"azimuthal equidistant", "azimuthal equi-area",
|
"azimuthal equidistant", "azimuthal equi-area",
|
||||||
@ -607,6 +595,9 @@ namespace conformal {
|
|||||||
dialog::addSelItem(XLAT("which coefficient"), its(polygonal::coefid), 'n');
|
dialog::addSelItem(XLAT("which coefficient"), its(polygonal::coefid), 'n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pmodel == mdHalfplane)
|
||||||
|
dialog::addBoolItem(XLAT("lower half-plane"), lower_halfplane, 'l');
|
||||||
|
|
||||||
if(pmodel == mdBall)
|
if(pmodel == mdBall)
|
||||||
dialog::addSelItem(XLAT("projection in ball model"), fts3(vid.ballproj), 'x');
|
dialog::addSelItem(XLAT("projection in ball model"), fts3(vid.ballproj), 'x');
|
||||||
|
|
||||||
@ -652,6 +643,8 @@ namespace conformal {
|
|||||||
config_camera_rotation();
|
config_camera_rotation();
|
||||||
else if(uni == 'u')
|
else if(uni == 'u')
|
||||||
pushScreen(rug::show);
|
pushScreen(rug::show);
|
||||||
|
else if(uni == 'l' && pmodel == mdHalfplane)
|
||||||
|
lower_halfplane = !lower_halfplane;
|
||||||
else if(uni == 'a')
|
else if(uni == 'a')
|
||||||
pushScreen(history_menu);
|
pushScreen(history_menu);
|
||||||
else if(uni == 'l') {
|
else if(uni == 'l') {
|
||||||
|
1
hyper.h
1
hyper.h
@ -899,6 +899,7 @@ namespace conformal {
|
|||||||
extern bool includeHistory;
|
extern bool includeHistory;
|
||||||
extern ld rotation;
|
extern ld rotation;
|
||||||
extern int do_rotate;
|
extern int do_rotate;
|
||||||
|
extern bool lower_halfplane;
|
||||||
extern bool autoband;
|
extern bool autoband;
|
||||||
extern bool autobandhistory;
|
extern bool autobandhistory;
|
||||||
extern bool dospiral;
|
extern bool dospiral;
|
||||||
|
10
hypgraph.cpp
10
hypgraph.cpp
@ -241,16 +241,22 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
|
|||||||
ld x0, y0;
|
ld x0, y0;
|
||||||
x0 = H[0] / tz;
|
x0 = H[0] / tz;
|
||||||
y0 = H[1] / tz;
|
y0 = H[1] / tz;
|
||||||
|
if(conformal::lower_halfplane) x0 = -x0, y0 = -y0;
|
||||||
y0 += 1;
|
y0 += 1;
|
||||||
double rad = x0*x0 + y0*y0;
|
double rad = x0*x0 + y0*y0;
|
||||||
y0 /= rad;
|
y0 /= rad;
|
||||||
x0 /= rad;
|
x0 /= rad;
|
||||||
y0 -= .5;
|
y0 -= .5;
|
||||||
|
|
||||||
|
if(conformal::lower_halfplane) x0 = -x0, y0 = -y0;
|
||||||
|
|
||||||
if(pmodel == mdHalfplane) {
|
if(pmodel == mdHalfplane) {
|
||||||
ret[0] = x0;
|
ret[0] = x0;
|
||||||
if(wmspatial || mmspatial) y0 *= zlev;
|
if(wmspatial || mmspatial) {
|
||||||
ret[1] = 1 - y0;
|
if(conformal::lower_halfplane) y0 /= zlev;
|
||||||
|
else y0 *= zlev;
|
||||||
|
}
|
||||||
|
ret[1] = (conformal::lower_halfplane?-1:1) - y0;
|
||||||
ret[2] = 0;
|
ret[2] = 0;
|
||||||
if(zlev != 1 && stereo::active())
|
if(zlev != 1 && stereo::active())
|
||||||
apply_depth(ret, -y0 * geom3::factor_to_lev(zlev));
|
apply_depth(ret, -y0 * geom3::factor_to_lev(zlev));
|
||||||
|
@ -306,7 +306,7 @@ void showMainMenu() {
|
|||||||
void editScale() {
|
void editScale() {
|
||||||
dialog::editNumber(vid.scale, .001, 1000, .1, 1, XLAT("scale factor"),
|
dialog::editNumber(vid.scale, .001, 1000, .1, 1, XLAT("scale factor"),
|
||||||
XLAT("Scale the displayed model."));
|
XLAT("Scale the displayed model."));
|
||||||
dialog::scaleLog();
|
dialog::scaleSinh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void showDisplayMode() {
|
void showDisplayMode() {
|
||||||
|
Loading…
Reference in New Issue
Block a user