1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

style improved

This commit is contained in:
Zeno Rogue 2020-06-08 01:59:34 +02:00
parent 1fdcb42195
commit 295bda1438

View File

@ -5,16 +5,21 @@
namespace hr {
vector<pair<transmatrix, color_t>> heps;
/* vertices of the Magma's heptagon */
array<hyperpoint, 8> vertices;
/* how are all Magma's heptagons transformed and colored */
vector<pair<transmatrix, color_t>> heps;
int magmashape = 0;
int magmacount = 1000;
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) {
hyperpoint vl = vertices[a];
@ -37,6 +42,8 @@ EX transmatrix get_adj(int a, int b) {
}
void make() {
/* compute the vertices */
for(int i=0; i<=7; i++)
vertices[i] = spin(2*M_PI*i/7) * xpush0(1);
ld xx = vertices[2][0];
@ -51,6 +58,8 @@ void make() {
heps.emplace_back(T, heps.back().second ^ 0xFFFF00);
};
/* create the core */
switch(magmashape) {
case 1:
@ -100,6 +109,8 @@ void make() {
break;
}
/* center the core */
hyperpoint center = Hypc;
for(auto& h: heps) for(int i=0; i<7; i++)
center += h.first * vertices[i];
@ -108,7 +119,7 @@ void make() {
for(auto& h: heps) h.first = gpushxto0(center) * h.first;
if(1) {
/* grow */
for(int a=0; a<magmacount; a++) {
hyperpoint p = heps.back().first * vertices[2];
@ -149,7 +160,6 @@ void make() {
println(hlog, "big = ", big, "small = ", small);
}
}
}
}