mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	small hyperboloid projection
This commit is contained in:
		
							
								
								
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -258,6 +258,7 @@ struct projection_configuration { | |||||||
|   ld offside, offside2; |   ld offside, offside2; | ||||||
|   ld aitoff_parameter, miller_parameter, loximuthal_parameter, winkel_parameter; |   ld aitoff_parameter, miller_parameter, loximuthal_parameter, winkel_parameter; | ||||||
|   bool show_hyperboloid_flat; |   bool show_hyperboloid_flat; | ||||||
|  |   bool small_hyperboloid; | ||||||
|   bool collignon_reflected; |   bool collignon_reflected; | ||||||
|   string formula; |   string formula; | ||||||
|   eModel basic_model; |   eModel basic_model; | ||||||
|   | |||||||
| @@ -1007,6 +1007,8 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) { | |||||||
|         } |         } | ||||||
|       #endif |       #endif | ||||||
|        |        | ||||||
|  |       if(pconf.small_hyperboloid) H = mid(H, C0); | ||||||
|  |  | ||||||
|       ret = H; |       ret = H; | ||||||
|  |  | ||||||
|       if(sphere && pmodel == mdHyperboloidFlat) { |       if(sphere && pmodel == mdHyperboloidFlat) { | ||||||
| @@ -2673,7 +2675,9 @@ EX void draw_model_elements() { | |||||||
|     case mdHemisphere: { |     case mdHemisphere: { | ||||||
|       if(!pconf.show_hyperboloid_flat) return; |       if(!pconf.show_hyperboloid_flat) return; | ||||||
|       if(models::is_hyperboloid(pmodel)) { |       if(models::is_hyperboloid(pmodel)) { | ||||||
|  |  | ||||||
| #if CAP_QUEUE | #if CAP_QUEUE | ||||||
|  |         if(pconf.small_hyperboloid) queueaction(PPR::CIRCLE, [] { glflush(); pconf.small_hyperboloid = false; }); | ||||||
|         curvepoint(point3(0,0,1)); |         curvepoint(point3(0,0,1)); | ||||||
|         curvepoint(point3(0,0,-pconf.alpha)); |         curvepoint(point3(0,0,-pconf.alpha)); | ||||||
|         queuecurve(shiftless(Id), ringcolor, 0, PPR::CIRCLE); |         queuecurve(shiftless(Id), ringcolor, 0, PPR::CIRCLE); | ||||||
| @@ -2709,6 +2713,7 @@ EX void draw_model_elements() { | |||||||
|         a[0] = -a[0]; |         a[0] = -a[0]; | ||||||
|         curvepoint(a); |         curvepoint(a); | ||||||
|         queuecurve(shiftless(Id), ringcolor, 0, PPR::CIRCLE); |         queuecurve(shiftless(Id), ringcolor, 0, PPR::CIRCLE); | ||||||
|  |         if(pconf.small_hyperboloid) queueaction(PPR::CIRCLE, [] { glflush(); pconf.small_hyperboloid = true; }); | ||||||
| #endif | #endif | ||||||
|         } |         } | ||||||
|       return; |       return; | ||||||
| @@ -3004,8 +3009,9 @@ EX void draw_boundary(int w) { | |||||||
|             queuereset(pmodel, p1); |             queuereset(pmodel, p1); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  |           int mul = pconf.small_hyperboloid ? 2 : 1; | ||||||
|           for(ld t=0; t<=360; t ++) |           for(ld t=0; t<=360; t ++) | ||||||
|             curvepoint(xspinpush0(t * degree, it ? M_PI - mz : mz)); |             curvepoint(xspinpush0(t * degree, it ? M_PI - mz * mul: mz * mul)); | ||||||
|  |  | ||||||
|           if(p1 == PPR::OUTCIRCLE) { queuecurve_reuse(shiftless(Id), lc, fc1, p1); fc1 = 0; p1 = PPR::CIRCLE; } |           if(p1 == PPR::OUTCIRCLE) { queuecurve_reuse(shiftless(Id), lc, fc1, p1); fc1 = 0; p1 = PPR::CIRCLE; } | ||||||
|           queuecurve(shiftless(Id), lc, fc1, p1); |           queuecurve(shiftless(Id), lc, fc1, p1); | ||||||
|   | |||||||
| @@ -140,6 +140,7 @@ projection_configuration::projection_configuration() { | |||||||
|   *ptr_ball = cspin(1, 2, 20._deg); |   *ptr_ball = cspin(1, 2, 20._deg); | ||||||
|   ptr_camera = new transmatrix; *ptr_camera = Id; |   ptr_camera = new transmatrix; *ptr_camera = Id; | ||||||
|   offside = 0; offside2 = M_PI; |   offside = 0; offside2 = M_PI; | ||||||
|  |   small_hyperboloid = false; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| EX namespace models { | EX namespace models { | ||||||
| @@ -625,8 +626,10 @@ EX namespace models { | |||||||
|       add_edit(vpconf.fisheye_alpha); |       add_edit(vpconf.fisheye_alpha); | ||||||
|       } |       } | ||||||
|  |  | ||||||
|     if(is_hyperboloid(vpmodel)) |     if(is_hyperboloid(vpmodel)) { | ||||||
|       add_edit(pconf.show_hyperboloid_flat); |       add_edit(pconf.show_hyperboloid_flat); | ||||||
|  |       add_edit(pconf.small_hyperboloid); | ||||||
|  |       } | ||||||
|      |      | ||||||
|     if(vpmodel == mdCollignon)  |     if(vpmodel == mdCollignon)  | ||||||
|       add_edit(vpconf.collignon_parameter); |       add_edit(vpconf.collignon_parameter); | ||||||
| @@ -1041,6 +1044,10 @@ EX namespace models { | |||||||
|       param_b(p.show_hyperboloid_flat, sp+"hyperboloid-flat", true) |       param_b(p.show_hyperboloid_flat, sp+"hyperboloid-flat", true) | ||||||
|       -> editable("show flat", 'b'); |       -> editable("show flat", 'b'); | ||||||
|    |    | ||||||
|  |       param_b(p.small_hyperboloid, sp+"hyperboloid-small", true) | ||||||
|  |       -> editable("small hyperboloid model", 't') | ||||||
|  |       -> help("as in Clifford algebras"); | ||||||
|  |  | ||||||
|       param_f(p.skiprope, sp+"mobius", 0) |       param_f(p.skiprope, sp+"mobius", 0) | ||||||
|       -> editable(0, 360, 15, "Möbius transformations", "", 'S')->unit = "°"; |       -> editable(0, 360, 15, "Möbius transformations", "", 'S')->unit = "°"; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue