diff --git a/hypgraph.cpp b/hypgraph.cpp index 6383cae2..ac415b32 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -853,6 +853,7 @@ EX void applymodel(hyperpoint H, hyperpoint& ret) { ret[0] = -sin(alpha) * r; ret[1] = cos(alpha) * r; + if(euclid) ret = models::euclidean_spin * ret; ret[2] = (r-1) * sqrt( pow(360/models::spiral_cone, 2) - 1); models::apply_ball(ret[2], ret[1]); @@ -861,6 +862,7 @@ EX void applymodel(hyperpoint H, hyperpoint& ret) { z = exp(z); ret[0] = real(z); ret[1] = imag(z); + if(euclid) ret = models::euclidean_spin * ret; if(vid.skiprope) ret = mobius(ret, vid.skiprope, 1); diff --git a/models.cpp b/models.cpp index 175f38a6..b2d0b288 100644 --- a/models.cpp +++ b/models.cpp @@ -160,6 +160,9 @@ EX namespace models { EX ld spiral_cone_rad; EX bool ring_not_spiral; + /** the matrix to rotate the Euclidean view from the standard coordinates to the screen coordinates */ + EX transmatrix euclidean_spin; + EX ld product_z_scale = 1; EX void configure() { @@ -187,7 +190,9 @@ EX namespace models { spiral_multiplier = cld(cos_spiral, sin_spiral) * cld(spiral_cone_rad * mul / 2., 0); } if(euclid) { - hyperpoint h = C0 + (eumove(as_coord({1,0}))*C0 - C0) * spiral_x + (eumove(as_coord({0,1}))*C0 - C0) * spiral_y; + euclidean_spin = pispin * inverse(cview() * master_relative(centerover, true)); + euclidean_spin = gpushxto0(euclidean_spin * C0) * euclidean_spin; + hyperpoint h = inverse(euclidean_spin) * (C0 + (eumove(as_coord({1,0}))*C0 - C0) * spiral_x + (eumove(as_coord({0,1}))*C0 - C0) * spiral_y); spiral_multiplier = cld(0, 2 * M_PI) / cld(h[0], h[1]); }