mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
fisheye has parameter
This commit is contained in:
parent
a5579af826
commit
13ea55b233
@ -441,6 +441,7 @@ EX void initConfig() {
|
|||||||
addsaverenum(vid.stereo_mode, "stereo-mode");
|
addsaverenum(vid.stereo_mode, "stereo-mode");
|
||||||
addsaver(vid.euclid_to_sphere, "euclid to sphere projection", 1.5);
|
addsaver(vid.euclid_to_sphere, "euclid to sphere projection", 1.5);
|
||||||
addsaver(vid.twopoint_param, "twopoint parameter", 1);
|
addsaver(vid.twopoint_param, "twopoint parameter", 1);
|
||||||
|
addsaver(vid.fisheye_param, "fisheye parameter", 1);
|
||||||
addsaver(vid.stretch, "stretch", 1);
|
addsaver(vid.stretch, "stretch", 1);
|
||||||
addsaver(vid.binary_width, "binary-tiling-width", 1);
|
addsaver(vid.binary_width, "binary-tiling-width", 1);
|
||||||
addsaver(vid.collignon_parameter, "collignon-parameter", 1);
|
addsaver(vid.collignon_parameter, "collignon-parameter", 1);
|
||||||
@ -2438,6 +2439,7 @@ EX unordered_map<string, ld&> params = {
|
|||||||
{"ets", vid.euclid_to_sphere},
|
{"ets", vid.euclid_to_sphere},
|
||||||
{"stretch", vid.stretch},
|
{"stretch", vid.stretch},
|
||||||
{"twopoint", vid.twopoint_param},
|
{"twopoint", vid.twopoint_param},
|
||||||
|
{"fisheye", vid.fisheye_param},
|
||||||
{"bwidth", vid.binary_width},
|
{"bwidth", vid.binary_width},
|
||||||
#if CAP_ANIMATIONS
|
#if CAP_ANIMATIONS
|
||||||
{"aperiod", anims::period},
|
{"aperiod", anims::period},
|
||||||
|
2
hyper.h
2
hyper.h
@ -228,7 +228,7 @@ enum eStereo { sOFF, sAnaglyph, sLR, sODS };
|
|||||||
|
|
||||||
struct videopar {
|
struct videopar {
|
||||||
ld scale, alpha, sspeed, mspeed, yshift, camera_angle;
|
ld scale, alpha, sspeed, mspeed, yshift, camera_angle;
|
||||||
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch, binary_width, fixed_facing_dir;
|
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, fisheye_param, stretch, binary_width, fixed_facing_dir;
|
||||||
int mobilecompasssize;
|
int mobilecompasssize;
|
||||||
int radarsize; // radar for 3D geometries
|
int radarsize; // radar for 3D geometries
|
||||||
ld radarrange;
|
ld radarrange;
|
||||||
|
@ -497,6 +497,7 @@ EX void applymodel(hyperpoint H, hyperpoint& ret) {
|
|||||||
case mdFisheye: {
|
case mdFisheye: {
|
||||||
ld zlev = find_zlev(H);
|
ld zlev = find_zlev(H);
|
||||||
H = space_to_perspective(H);
|
H = space_to_perspective(H);
|
||||||
|
H /= vid.fisheye_param;
|
||||||
H[LDIM] = zlev;
|
H[LDIM] = zlev;
|
||||||
ret = H / sqrt(1 + sqhypot_d(GDIM+1, H));
|
ret = H / sqrt(1 + sqhypot_d(GDIM+1, H));
|
||||||
if(GDIM == 3) ret[LDIM] = zlev;
|
if(GDIM == 3) ret[LDIM] = zlev;
|
||||||
|
10
models.cpp
10
models.cpp
@ -560,6 +560,16 @@ EX namespace models {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pmodel == mdFisheye) {
|
||||||
|
dialog::addSelItem(XLAT("parameter"), fts(vid.fisheye_param), 'b');
|
||||||
|
dialog::add_action([](){
|
||||||
|
dialog::editNumber(vid.fisheye_param, 1e-3, 10, .1, 1, XLAT("parameter"),
|
||||||
|
"Size of the fish eye."
|
||||||
|
);
|
||||||
|
dialog::scaleLog();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(pmodel == mdCollignon) {
|
if(pmodel == mdCollignon) {
|
||||||
dialog::addSelItem(XLAT("parameter"), fts(vid.collignon_parameter) + (vid.collignon_reflected ? " (r)" : ""), 'b');
|
dialog::addSelItem(XLAT("parameter"), fts(vid.collignon_parameter) + (vid.collignon_reflected ? " (r)" : ""), 'b');
|
||||||
dialog::add_action([](){
|
dialog::add_action([](){
|
||||||
|
Loading…
Reference in New Issue
Block a user