From 89aa64d52bc3012becf29866fe89d338e212603f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 8 Jun 2020 01:54:55 +0200 Subject: [PATCH] better centering --- rogueviz/magmahep.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rogueviz/magmahep.cpp b/rogueviz/magmahep.cpp index 3daae8d6..7102b055 100644 --- a/rogueviz/magmahep.cpp +++ b/rogueviz/magmahep.cpp @@ -43,7 +43,7 @@ void make() { vertices[3][0] = 2 * xx - vertices[3][0]; vertices[4][0] = 2 * xx - vertices[4][0]; - heps.emplace_back(gpushxto0(vertices[2]), 0xFFFFFFFF); + heps.emplace_back(Id, 0xFFFFFFFF); switch(magmashape) { @@ -93,6 +93,14 @@ void make() { } break; } + + hyperpoint center = Hypc; + for(auto& h: heps) for(int i=0; i<7; i++) + center += h.first * vertices[i]; + + center = normalize(center); + + for(auto& h: heps) h.first = gpushxto0(center) * h.first; if(1) {