mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-26 21:37:02 +00:00
variant fisheye projection
This commit is contained in:
parent
31471fc6c5
commit
4c6c44cc26
@ -1031,7 +1031,7 @@ enum eModel : int {
|
||||
// 39..48
|
||||
mdPoorMan, mdPanini, mdRetroCraig, mdRetroLittrow, mdRetroHammer, mdThreePoint, mdLiePerspective, mdLieOrthogonal, mdRelPerspective, mdRelOrthogonal,
|
||||
// 49..50
|
||||
mdHorocyclicEqa, mdConformalSquare,
|
||||
mdHorocyclicEqa, mdConformalSquare, mdFisheye2,
|
||||
// 51..
|
||||
mdGUARD, mdPixel, mdHyperboloidFlat, mdPolynomial, mdManual
|
||||
};
|
||||
@ -1095,6 +1095,7 @@ EX vector<modelinfo> mdinf = {
|
||||
{X3("relativistic orthogonal"), mf::euc_boring},
|
||||
{X3("horocyclic equal-area"), mf::euc_boring | mf::equiarea | mf::orientation | mf::horocyclic},
|
||||
{X3("conformal square"), mf::orientation | mf::broken | mf::transition},
|
||||
{X3("variant fisheye"), 0},
|
||||
{X3("guard"), mf::technical},
|
||||
{X3("pixel"), mf::technical},
|
||||
{X3("hypflat"), mf::technical},
|
||||
|
@ -3273,7 +3273,7 @@ EX int haveaura() {
|
||||
if(sphere && mdAzimuthalEqui()) return 0;
|
||||
if(among(pmodel, mdJoukowsky, mdJoukowskyInverted) && hyperbolic && pconf.model_transition < 1)
|
||||
return 2;
|
||||
if(pmodel == mdFisheye) return 1;
|
||||
if(among(pmodel, mdFisheye, mdFisheye2)) return 1;
|
||||
return pmodel == mdDisk && (!sphere || pconf.alpha > 10) && !euclid;
|
||||
}
|
||||
|
||||
|
3
help.cpp
3
help.cpp
@ -240,7 +240,8 @@ EX void buildCredits() {
|
||||
"Kojiguchi Kazuki, baconcow, Alan, SurelyYouJest, hotdogPi, DivisionByZero, xXxWeedGokuxXx, jpystynen, Dmitry Marakasov, Alexandre Moine, Arthur O'Dwyer, "
|
||||
"Triple_Agent_AAA, bluetailedgnat, Allalinor, Shitford, KittyTac, Christopher King, KosGD, TravelDemon, Bubbles, rdococ, frozenlake, MagmaMcFry, "
|
||||
"Snakebird Priestess, roaringdragon2, Stopping Dog, bengineer8, Sir Light IJIJ, ShadeBlade, Saplou, shnourok, Ralith, madasa, 6% remaining, Chimera245, Remik Pi, alien foxcat thing, "
|
||||
"Piotr Grochowski, Ann, still-flow, tyzone, Paradoxica, LottieRatWorld, aismallard, albatross, EncodedSpirit, Jacob Mandelson, CrashTuvai, cvoight, jennlbw, Kali Ranya, spiritbackup, Dylan, L_Lord, AntiRogue"
|
||||
"Piotr Grochowski, Ann, still-flow, tyzone, Paradoxica, LottieRatWorld, aismallard, albatross, EncodedSpirit, Jacob Mandelson, CrashTuvai, cvoight, jennlbw, Kali Ranya, spiritbackup, Dylan, L_Lord, AntiRogue, "
|
||||
"masonlgreen"
|
||||
);
|
||||
#ifdef EXTRALICENSE
|
||||
help += EXTRALICENSE;
|
||||
|
25
hypgraph.cpp
25
hypgraph.cpp
@ -1055,6 +1055,27 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
|
||||
break;
|
||||
}
|
||||
|
||||
case mdFisheye2: {
|
||||
ld zlev;
|
||||
if(nonisotropic) {
|
||||
H = lp_apply(inverse_exp(H_orig));
|
||||
zlev = 1;
|
||||
}
|
||||
else {
|
||||
zlev = find_zlev(H);
|
||||
H = space_to_perspective(H);
|
||||
}
|
||||
H /= pconf.fisheye_param;
|
||||
auto H1 = perspective_to_space(H, pconf.fisheye_alpha, gcSphere);
|
||||
auto H2 = perspective_to_space(hyperpoint(1e6, 0, 0, 0), pconf.fisheye_alpha, gcSphere);
|
||||
H1[2] += 1;
|
||||
H1 /= H1[2];
|
||||
H1 /= H2[0] / (H2[2]+1);
|
||||
ret = H1;
|
||||
if(GDIM == 3) ret[LDIM] = zlev;
|
||||
break;
|
||||
}
|
||||
|
||||
case mdSimulatedPerspective: {
|
||||
models::scr_to_ori(H);
|
||||
auto yz = move_z_to_y(H);
|
||||
@ -2475,7 +2496,7 @@ EX transmatrix atscreenpos(ld x, ld y, ld size) {
|
||||
|
||||
void circle_around_center(ld radius, color_t linecol, color_t fillcol, PPR prio) {
|
||||
#if CAP_QUEUE
|
||||
if(among(pmodel, mdDisk, mdEquiarea, mdEquidistant, mdFisheye) && !(pmodel == mdDisk && hyperbolic && pconf.alpha <= -1) && models::camera_straight) {
|
||||
if(among(pmodel, mdDisk, mdEquiarea, mdEquidistant, mdFisheye, mdFisheye2) && !(pmodel == mdDisk && hyperbolic && pconf.alpha <= -1) && models::camera_straight) {
|
||||
hyperpoint ret;
|
||||
applymodel(shiftless(xpush0(radius)), ret);
|
||||
ld r = hypot_d(2, ret);
|
||||
@ -2733,7 +2754,7 @@ EX void draw_boundary(int w) {
|
||||
}
|
||||
|
||||
if(w == 1) return;
|
||||
if(nonisotropic || (euclid && !among(pmodel, mdFisheye, mdConformalSquare, mdHemisphere)) || gproduct) return;
|
||||
if(nonisotropic || (euclid && !among(pmodel, mdFisheye, mdFisheye2, mdConformalSquare, mdHemisphere)) || gproduct) return;
|
||||
#if CAP_VR
|
||||
if(vrhr::active() && pmodel == mdHyperboloid) return;
|
||||
#endif
|
||||
|
12
models.cpp
12
models.cpp
@ -619,6 +619,11 @@ EX namespace models {
|
||||
if(vpmodel == mdFisheye)
|
||||
add_edit(vpconf.fisheye_param);
|
||||
|
||||
if(vpmodel == mdFisheye2) {
|
||||
add_edit(vpconf.fisheye_param);
|
||||
add_edit(vpconf.fisheye_alpha);
|
||||
}
|
||||
|
||||
if(is_hyperboloid(vpmodel))
|
||||
add_edit(pconf.show_hyperboloid_flat);
|
||||
|
||||
@ -974,6 +979,13 @@ EX namespace models {
|
||||
-> editable(1e-3, 10, .1, "fisheye parameter", "Size of the fish eye.", 'b')
|
||||
-> set_sets(dialog::scaleLog);
|
||||
|
||||
param_f(p.fisheye_alpha, pp+"fishalpha", sp+"off-center parameter", 0)
|
||||
-> editable(1e-1, 10, .1, "off-center parameter",
|
||||
"This projection is obtained by composing gnomonic projection and inverse stereographic projection. "
|
||||
"This parameter changes the center of the first projection (0 = gnomonic, 1 = stereographic). Use a value closer to 1 "
|
||||
"to make the projection more conformal.",
|
||||
'o');
|
||||
|
||||
param_f(p.stretch, pp+"stretch", 1)
|
||||
-> editable(0, 10, .1, "vertical stretch", "Vertical stretch factor.", 's')
|
||||
-> set_extra(stretch_extra);
|
||||
|
Loading…
x
Reference in New Issue
Block a user