mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-29 06:03:11 +00:00
style improved
This commit is contained in:
parent
1fdcb42195
commit
295bda1438
@ -5,16 +5,21 @@
|
|||||||
|
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
vector<pair<transmatrix, color_t>> heps;
|
/* vertices of the Magma's heptagon */
|
||||||
|
|
||||||
array<hyperpoint, 8> vertices;
|
array<hyperpoint, 8> vertices;
|
||||||
|
|
||||||
|
/* how are all Magma's heptagons transformed and colored */
|
||||||
|
vector<pair<transmatrix, color_t>> heps;
|
||||||
|
|
||||||
int magmashape = 0;
|
int magmashape = 0;
|
||||||
|
|
||||||
int magmacount = 1000;
|
int magmacount = 1000;
|
||||||
|
|
||||||
int magmalong = 10;
|
int magmalong = 10;
|
||||||
|
|
||||||
|
/* transformation from the original to the next heptagon;
|
||||||
|
edge a of the original heptagon matches edge b of the next heptagon */
|
||||||
|
|
||||||
EX transmatrix get_adj(int a, int b) {
|
EX transmatrix get_adj(int a, int b) {
|
||||||
|
|
||||||
hyperpoint vl = vertices[a];
|
hyperpoint vl = vertices[a];
|
||||||
@ -37,6 +42,8 @@ EX transmatrix get_adj(int a, int b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void make() {
|
void make() {
|
||||||
|
|
||||||
|
/* compute the vertices */
|
||||||
for(int i=0; i<=7; i++)
|
for(int i=0; i<=7; i++)
|
||||||
vertices[i] = spin(2*M_PI*i/7) * xpush0(1);
|
vertices[i] = spin(2*M_PI*i/7) * xpush0(1);
|
||||||
ld xx = vertices[2][0];
|
ld xx = vertices[2][0];
|
||||||
@ -51,6 +58,8 @@ void make() {
|
|||||||
heps.emplace_back(T, heps.back().second ^ 0xFFFF00);
|
heps.emplace_back(T, heps.back().second ^ 0xFFFF00);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* create the core */
|
||||||
|
|
||||||
switch(magmashape) {
|
switch(magmashape) {
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
@ -100,6 +109,8 @@ void make() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* center the core */
|
||||||
|
|
||||||
hyperpoint center = Hypc;
|
hyperpoint center = Hypc;
|
||||||
for(auto& h: heps) for(int i=0; i<7; i++)
|
for(auto& h: heps) for(int i=0; i<7; i++)
|
||||||
center += h.first * vertices[i];
|
center += h.first * vertices[i];
|
||||||
@ -108,7 +119,7 @@ void make() {
|
|||||||
|
|
||||||
for(auto& h: heps) h.first = gpushxto0(center) * h.first;
|
for(auto& h: heps) h.first = gpushxto0(center) * h.first;
|
||||||
|
|
||||||
if(1) {
|
/* grow */
|
||||||
|
|
||||||
for(int a=0; a<magmacount; a++) {
|
for(int a=0; a<magmacount; a++) {
|
||||||
hyperpoint p = heps.back().first * vertices[2];
|
hyperpoint p = heps.back().first * vertices[2];
|
||||||
@ -149,7 +160,6 @@ void make() {
|
|||||||
println(hlog, "big = ", big, "small = ", small);
|
println(hlog, "big = ", big, "small = ", small);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user