1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-27 13:48:15 +00:00

improvements to the ODS projection

This commit is contained in:
Zeno Rogue 2018-01-29 16:31:14 +01:00
parent e590000627
commit d7158bcdbe

View File

@ -957,10 +957,10 @@ ld raddif(ld a, ld b) {
} }
bool ods = false; bool ods = false;
ld ipd = 0.1; ld ipd = 0.05;
bool project_ods(hyperpoint azeq, hyperpoint& h1, hyperpoint& h2, bool eye) { bool project_ods(hyperpoint azeq, hyperpoint& h1, hyperpoint& h2, bool eye) {
ld tanalpha = tan(ipd); ld tanalpha = tan(ipd/2);
if(eye) tanalpha = -tanalpha; if(eye) tanalpha = -tanalpha;
using namespace hyperpoint_vec; using namespace hyperpoint_vec;
@ -989,7 +989,7 @@ bool project_ods(hyperpoint azeq, hyperpoint& h1, hyperpoint& h2, bool eye) {
ld phi = atan2(y, x) - atan2(y0, x0); ld phi = atan2(y, x) - atan2(y0, x0);
ld delta = atan2(z / sin(theta), t / cos(ipd)); ld delta = atan2(z / sin(theta), t / cos(ipd/2));
h[0] = phi; h[0] = phi;
h[1] = theta; h[1] = theta;
@ -1751,6 +1751,9 @@ int rugArgs() {
else if(argis("-ods")) { else if(argis("-ods")) {
ods = true; ods = true;
}
else if(argis("-ipd")) {
shift(); ipd = argf(); shift(); ipd = argf();
} }