diff --git a/geom-exp.cpp b/geom-exp.cpp index 2767e939..783068c9 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -279,8 +279,12 @@ void set_or_configure_geometry(eGeometry g) { #endif else { if(among(g, gProduct, gRotSpace)) { - if(WDIM == 3 || euclid) { - addMessage(XLAT("Only works with 2D non-Euclidean geometries")); + if(WDIM == 3 || (g == gRotSpace && euclid)) { + addMessage(XLAT( + g == gRotSpace ? + "Only works with 2D non-Euclidean geometries" + : "Only works with 2D geometries" + )); return; } if(g == gRotSpace) { diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 780afb84..384253fe 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -373,6 +373,7 @@ EX ld zlevel(const hyperpoint &h) { if(sl2) return sqrt(-intval(h, Hypc)); else if(translatable) return h[LDIM]; else if(sphere) return sqrt(intval(h, Hypc)); + else if(in_e2xe()) return log(h[2]); else if(prod) return log(sqrt(abs(intval(h, Hypc)))); /* abs works with both underlying spherical and hyperbolic */ else return (h[LDIM] < 0 ? -1 : 1) * sqrt(-intval(h, Hypc)); } diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 65e52bb9..a8531aea 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1226,15 +1226,17 @@ EX namespace product { cell *c = cw.at; if(sphere) gmatrix[c] = V; /* some computations need gmatrix0 for underlying geometry */ bool s = sphere || pmodel != mdPerspective; + bool euc = euclid; hybrid::in_actual([&] { cell *c0 = hybrid::get_at(c, z0); cwall_offset = hybrid::wall_offset(c0); if(s) cwall_mask = (1<type) - 1; else { cwall_mask = 0; - ld d = V[2][2]; + ld d = euc ? sqhypot_d(2, tC0(V)) : V[2][2]; for(int i=0; itype; i++) { - ld d1 = (V * cgi.walltester[cwall_offset + i])[2]; + hyperpoint h = (V * cgi.walltester[cwall_offset + i]); + ld d1 = euc ? sqhypot_d(2, h) : h[2]; if(d1 < d - 1e-6) cwall_mask |= (1< write_shader(flagtype shader_flags) { distfun = "sqrt(z*z+d*d)"; treset = true; } + else if(in_e2xe() && pmodel == mdPerspective) { + shader_flags |= SF_PERS3 | SF_DIRECT; + coordinator += + "t.xy /= t.z;\n" + "t.z = log(t.z);\n"; + distfun = "length(t.xyz)"; + treset = true; + } else if(in_s2xe() && pmodel == mdPerspective) { shader_flags |= SF_PERS3 | SF_DIRECT; distfun = "length(t.xyz)", treset = true;