mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	2D3D: fixed Goldberg
This commit is contained in:
		| @@ -82,7 +82,7 @@ matrixitem genitem(const transmatrix& m1, const transmatrix& m2, int nsym) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| void addmatrix(matrixlist& matrices, hyperpoint o0, hyperpoint o1, hyperpoint o2, hyperpoint n0, hyperpoint n1, hyperpoint n2, int d, int osym, int nsym) { | void addmatrix(matrixlist& matrices, hyperpoint o0, hyperpoint o1, hyperpoint o2, hyperpoint n0, hyperpoint n1, hyperpoint n2, int d, int osym, int nsym) { | ||||||
|   matrices.v.push_back(genitem(inverse(spin(2*M_PI*d/osym)*build_matrix(o0, o1, o2)), spin(2*M_PI*d/nsym)*build_matrix(n0, n1, n2), nsym)); |   matrices.v.push_back(genitem(inverse(spin(2*M_PI*d/osym)*build_matrix(o0, o1, o2,C02)), spin(2*M_PI*d/nsym)*build_matrix(n0, n1, n2,C02), nsym)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| matrixlist hex_matrices, hept_matrices; | matrixlist hex_matrices, hept_matrices; | ||||||
| @@ -450,10 +450,10 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) { | |||||||
|              |              | ||||||
|             hyperpoint nlfar = farcorner(c, (d+cid+v+1) % cor, 0); |             hyperpoint nlfar = farcorner(c, (d+cid+v+1) % cor, 0); | ||||||
|             hyperpoint nrfar = farcorner(c, (d+cid+v+1) % cor, 1); |             hyperpoint nrfar = farcorner(c, (d+cid+v+1) % cor, 1); | ||||||
|             m.v[i].second[cid] = build_matrix(center, nlcorner, nrcorner); |             m.v[i].second[cid] = build_matrix(center, nlcorner, nrcorner,C02); | ||||||
|             m.v[i+1].second[cid] = build_matrix(nfar, nlcorner, nrcorner); |             m.v[i+1].second[cid] = build_matrix(nfar, nlcorner, nrcorner,C02); | ||||||
|             m.v[i+2].second[cid] = build_matrix(nfar, nlcorner, nlfar); |             m.v[i+2].second[cid] = build_matrix(nfar, nlcorner, nlfar,C02); | ||||||
|             m.v[i+3].second[cid] = build_matrix(nfar, nrcorner, nrfar); |             m.v[i+3].second[cid] = build_matrix(nfar, nrcorner, nrfar,C02); | ||||||
|             } |             } | ||||||
|            |            | ||||||
|           i += 4; |           i += 4; | ||||||
|   | |||||||
| @@ -513,7 +513,8 @@ namespace hr { namespace gp { | |||||||
|     return spin(-alpha) * build_matrix( |     return spin(-alpha) * build_matrix( | ||||||
|       C0,  |       C0,  | ||||||
|       ddspin(&cc, i) * xpush0(tessf), |       ddspin(&cc, i) * xpush0(tessf), | ||||||
|       ddspin(&cc, i+1) * xpush0(tessf) |       ddspin(&cc, i+1) * xpush0(tessf), | ||||||
|  |       C03 | ||||||
|       ); |       ); | ||||||
|     } |     } | ||||||
|    |    | ||||||
| @@ -521,7 +522,8 @@ namespace hr { namespace gp { | |||||||
|     corners = inverse(build_matrix( |     corners = inverse(build_matrix( | ||||||
|       loctoh_ort(loc(0,0)), |       loctoh_ort(loc(0,0)), | ||||||
|       loctoh_ort(param), |       loctoh_ort(param), | ||||||
|       loctoh_ort(param * loc(0,1)) |       loctoh_ort(param * loc(0,1)), | ||||||
|  |       C03 | ||||||
|       )); |       )); | ||||||
|     for(int i=0; i<S7; i++) { |     for(int i=0; i<S7; i++) { | ||||||
|       transmatrix T = dir_matrix(i); |       transmatrix T = dir_matrix(i); | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -3941,7 +3941,7 @@ transmatrix eupush3(ld x, ld y, ld z); | |||||||
| transmatrix eupush(hyperpoint h); | transmatrix eupush(hyperpoint h); | ||||||
| transmatrix rspintox(const hyperpoint& H); | transmatrix rspintox(const hyperpoint& H); | ||||||
| transmatrix gpushxto0(const hyperpoint& H); | transmatrix gpushxto0(const hyperpoint& H); | ||||||
| transmatrix build_matrix(hyperpoint h1, hyperpoint h2, hyperpoint h3); | transmatrix build_matrix(hyperpoint h1, hyperpoint h2, hyperpoint h3, hyperpoint h4); | ||||||
| hyperpoint normalize(hyperpoint H); | hyperpoint normalize(hyperpoint H); | ||||||
| ld signum(ld x); | ld signum(ld x); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -438,15 +438,13 @@ void set_column(transmatrix& T, int i, const hyperpoint& H) { | |||||||
|     T[j][i] = H[j]; |     T[j][i] = H[j]; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| transmatrix build_matrix(hyperpoint h1, hyperpoint h2, hyperpoint h3) { | transmatrix build_matrix(hyperpoint h1, hyperpoint h2, hyperpoint h3, hyperpoint h4) { | ||||||
|   transmatrix T; |   transmatrix T; | ||||||
|   for(int i=0; i<MDIM; i++) |   for(int i=0; i<MDIM; i++) | ||||||
|     T[i][0] = h1[i], |     T[i][0] = h1[i], | ||||||
|     T[i][1] = h2[i], |     T[i][1] = h2[i], | ||||||
|     T[i][2] = h3[i]; |     T[i][2] = h3[i]; | ||||||
|   if(DIM == 3)  |   if(MAXMDIM == 4) for(int i=0; i<MDIM; i++) T[i][3] = h4[i]; | ||||||
|     for(int i=0; i<MDIM; i++) |  | ||||||
|       T[i][3] = (i == WDIM); |  | ||||||
|   return T; |   return T; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								surface.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								surface.cpp
									
									
									
									
									
								
							| @@ -101,7 +101,7 @@ hyperpoint coord(hyperpoint h) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| ld det(hyperpoint h1, hyperpoint h2, hyperpoint h3) { | ld det(hyperpoint h1, hyperpoint h2, hyperpoint h3) { | ||||||
|   return det(build_matrix(h1, h2, h3)); |   return det(build_matrix(h1, h2, h3,C03)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| ld epsd = 1e-5; | ld epsd = 1e-5; | ||||||
| @@ -233,7 +233,7 @@ dexp_data dexp(hyperpoint p, hyperpoint t) { | |||||||
|    |    | ||||||
|   for(ld u=0; u<1; u += eps) { |   for(ld u=0; u<1; u += eps) { | ||||||
|      |      | ||||||
|     transmatrix T = build_matrix(coord_derivative(p, 0), coord_derivative(p, 1), Hypc); |     transmatrix T = build_matrix(coord_derivative(p, 0), coord_derivative(p, 1), Hypc, C03); | ||||||
|      |      | ||||||
|     // printf("Tt = %lf\n", hypot_d(3, T * t)); |     // printf("Tt = %lf\n", hypot_d(3, T * t)); | ||||||
|  |  | ||||||
| @@ -245,7 +245,7 @@ dexp_data dexp(hyperpoint p, hyperpoint t) { | |||||||
|     auto v0 = coord_derivative(p, 0); |     auto v0 = coord_derivative(p, 0); | ||||||
|     auto v1 = coord_derivative(p, 1); |     auto v1 = coord_derivative(p, 1); | ||||||
|  |  | ||||||
|     transmatrix T2 = build_matrix(v0, v1, v0 ^ v1); |     transmatrix T2 = build_matrix(v0, v1, v0 ^ v1, C03); | ||||||
|        |        | ||||||
|     t = inverse(T2) * T * t; |     t = inverse(T2) * T * t; | ||||||
|     t[2] = 0; |     t[2] = 0; | ||||||
| @@ -271,7 +271,7 @@ transmatrix create_M_matrix(hyperpoint zero, hyperpoint v1) { | |||||||
|   hyperpoint Te0 = coord_derivative(zero, 0); |   hyperpoint Te0 = coord_derivative(zero, 0); | ||||||
|   hyperpoint Te1 = coord_derivative(zero, 1); |   hyperpoint Te1 = coord_derivative(zero, 1); | ||||||
|  |  | ||||||
|   transmatrix T = build_matrix(Te0, Te1, Hypc); |   transmatrix T = build_matrix(Te0, Te1, Hypc, C03); | ||||||
|  |  | ||||||
|   v1 = v1 / hypot_d(3, T*v1); |   v1 = v1 / hypot_d(3, T*v1); | ||||||
|   hyperpoint v2 = hpxyz(1e-3, 1e-4, 0); |   hyperpoint v2 = hpxyz(1e-3, 1e-4, 0); | ||||||
| @@ -281,7 +281,7 @@ transmatrix create_M_matrix(hyperpoint zero, hyperpoint v1) { | |||||||
|   if((((T*v1) ^ (T*v2)) | ((T*unit_vector[0]) ^ (T*unit_vector[1]))) < 0) |   if((((T*v1) ^ (T*v2)) | ((T*unit_vector[0]) ^ (T*unit_vector[1]))) < 0) | ||||||
|     v2 = v2 * -1; |     v2 = v2 * -1; | ||||||
|    |    | ||||||
|   transmatrix M = build_matrix(v1, v2, Hypc); |   transmatrix M = build_matrix(v1, v2, Hypc, C03); | ||||||
|    |    | ||||||
|   println(hlog, M); |   println(hlog, M); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue