1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-30 09:17:57 +00:00

new projection: polar coordinates

This commit is contained in:
Zeno Rogue
2024-02-22 01:16:43 +01:00
parent 9a590ecc42
commit 9ce5c63708
4 changed files with 30 additions and 2 deletions

View File

@@ -1362,6 +1362,21 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
makeband(H_orig, ret, [] (ld& x, ld& y) { x *= cos_auto(y); });
break;
case mdPolar: {
models::scr_to_ori(H);
H = xpush(pconf.offside) * H;
ld zlev = find_zlev(H);
ld d = hdist0(H);
ld df, zf;
hypot_zlev(zlev, d, df, zf);
ret[0] = -atan2(H) / M_PI;
ret[1] = (d - pconf.offside2) / M_PI;
ret[2] = zf;
ret[3] = 1;
models::ori_to_scr(ret);
break;
}
case mdEquidistant: case mdEquiarea: case mdEquivolume: {
if(vrhr::rendering() && GDIM == 3 && pmodel == mdEquidistant) {
ret = inverse_exp(H_orig);