mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 17:40:36 +00:00
nilv:: geodesic wall surfaces
This commit is contained in:
parent
21a7869e0b
commit
4d64618600
@ -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 {
|
namespace nisot {
|
||||||
|
@ -717,6 +717,8 @@ void geometry_information::make_wall(int id, vector<hyperpoint> vertices, vector
|
|||||||
hyperpoint v2 = vertices[(a+1)%n] - center;
|
hyperpoint v2 = vertices[(a+1)%n] - center;
|
||||||
texture_order([&] (ld x, ld y) {
|
texture_order([&] (ld x, ld y) {
|
||||||
hyperpoint h = center + v1 * x + v2 * 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; }
|
if(sol || !binarytiling) { hpcpush(normalize(h)); return; }
|
||||||
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
|
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
|
||||||
hpcpush(res);
|
hpcpush(res);
|
||||||
@ -728,6 +730,8 @@ void geometry_information::make_wall(int id, vector<hyperpoint> vertices, vector
|
|||||||
int STEP = vid.texture_step;
|
int STEP = vid.texture_step;
|
||||||
for(int a=0; a<n; a++) for(int y=0; y<STEP; y++) {
|
for(int a=0; a<n; a++) for(int y=0; y<STEP; y++) {
|
||||||
hyperpoint h = (vertices[a] * (STEP-y) + vertices[(a+1)%n] * y)/STEP;
|
hyperpoint h = (vertices[a] * (STEP-y) + vertices[(a+1)%n] * y)/STEP;
|
||||||
|
if(nil)
|
||||||
|
h = nilv::on_geodesic(vertices[a], vertices[(a+1)%n], y * 1. / STEP);
|
||||||
if(sol || !binarytiling) { hpcpush(normalize(h)); continue; }
|
if(sol || !binarytiling) { hpcpush(normalize(h)); continue; }
|
||||||
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
|
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
|
||||||
hpcpush(res);
|
hpcpush(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user