From 4d64618600ccd7bedfcbbd714359fab0a4e035bc Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 6 Aug 2019 21:09:12 +0200 Subject: [PATCH] nilv:: geodesic wall surfaces --- nonisotropic.cpp | 7 +++++++ polygons.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 308e111d..d84ff17e 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -526,6 +526,13 @@ namespace nilv { } }; + + hyperpoint on_geodesic(hyperpoint s0, hyperpoint s1, ld x) { + using namespace hyperpoint_vec; + hyperpoint local = inverse(nisot::translate(s0)) * s1; + hyperpoint h = get_inverse_exp(local, 100); + return nisot::translate(s0) * formula_exp(h * x); + } } namespace nisot { diff --git a/polygons.cpp b/polygons.cpp index cde85e41..032bbb35 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -717,6 +717,8 @@ void geometry_information::make_wall(int id, vector vertices, vector hyperpoint v2 = vertices[(a+1)%n] - center; texture_order([&] (ld x, ld y) { hyperpoint h = center + v1 * x + v2 * y; + if(nil && (x || y)) + h = nilv::on_geodesic(center, nilv::on_geodesic(v1+center, v2+center, y / (x+y)), x + y); if(sol || !binarytiling) { hpcpush(normalize(h)); return; } hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]); hpcpush(res); @@ -728,6 +730,8 @@ void geometry_information::make_wall(int id, vector vertices, vector int STEP = vid.texture_step; for(int a=0; a