diff --git a/config.cpp b/config.cpp index c9c397f4..8c554d3b 100644 --- a/config.cpp +++ b/config.cpp @@ -441,6 +441,7 @@ EX void initConfig() { addsaverenum(vid.stereo_mode, "stereo-mode"); addsaver(vid.euclid_to_sphere, "euclid to sphere projection", 1.5); addsaver(vid.twopoint_param, "twopoint parameter", 1); + addsaver(vid.fisheye_param, "fisheye parameter", 1); addsaver(vid.stretch, "stretch", 1); addsaver(vid.binary_width, "binary-tiling-width", 1); addsaver(vid.collignon_parameter, "collignon-parameter", 1); @@ -2438,6 +2439,7 @@ EX unordered_map params = { {"ets", vid.euclid_to_sphere}, {"stretch", vid.stretch}, {"twopoint", vid.twopoint_param}, + {"fisheye", vid.fisheye_param}, {"bwidth", vid.binary_width}, #if CAP_ANIMATIONS {"aperiod", anims::period}, diff --git a/hyper.h b/hyper.h index 4fbe286b..339a4d80 100644 --- a/hyper.h +++ b/hyper.h @@ -228,7 +228,7 @@ enum eStereo { sOFF, sAnaglyph, sLR, sODS }; struct videopar { 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 radarsize; // radar for 3D geometries ld radarrange; diff --git a/hypgraph.cpp b/hypgraph.cpp index e721cec3..9dce8659 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -497,6 +497,7 @@ EX void applymodel(hyperpoint H, hyperpoint& ret) { case mdFisheye: { ld zlev = find_zlev(H); H = space_to_perspective(H); + H /= vid.fisheye_param; H[LDIM] = zlev; ret = H / sqrt(1 + sqhypot_d(GDIM+1, H)); if(GDIM == 3) ret[LDIM] = zlev; diff --git a/models.cpp b/models.cpp index e91e7391..48640fec 100644 --- a/models.cpp +++ b/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) { dialog::addSelItem(XLAT("parameter"), fts(vid.collignon_parameter) + (vid.collignon_reflected ? " (r)" : ""), 'b'); dialog::add_action([](){