diff --git a/rogueviz/triangle.cpp b/rogueviz/triangle.cpp index eec71383..c3d57c63 100644 --- a/rogueviz/triangle.cpp +++ b/rogueviz/triangle.cpp @@ -82,15 +82,15 @@ struct trianglemaker { hyperpoint start = point31(0, 0, 0); - double lastz; - - double lasta; - double ca; // compute how to scale this in Nil so that everything fits - for(ld a = 1e-5;; a+=1e-5) { + ld amin = 0, amax = 1; + + for(int it=0; it<100; it++) { + ld a = (amin + amax) / 2; + ca = a; hyperpoint at = start; for(int d=0; d<3; d++) { for(int i=0; i