mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 01:00:25 +00:00
models:: Spiral projection now spins together in Euclidean
This commit is contained in:
parent
1329ec6b04
commit
ecde911db2
@ -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);
|
||||
|
@ -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]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user