1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-07 10:52:23 +00:00

texture remapping to dual/bitruncated Archimedean

This commit is contained in:
Zeno Rogue
2018-08-30 17:54:04 +02:00
parent 218709b899
commit 2c1b8c3b14
3 changed files with 46 additions and 25 deletions

View File

@@ -292,9 +292,14 @@ void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const trans
mi.M = T * applyPatterndir(c, si);
mi.triangles.clear();
transmatrix iv = inverse(applyPatterndir(c, si));
int sd = si.dir;
if((NONSTDVAR) || binarytiling) sd = 0;
for(int i=0; i<c->type; i++) {
hyperpoint h1 = get_corner_position(c, (i + shift) % c->type);
hyperpoint h2 = get_corner_position(c, (i + shift + 1) % c->type);
hyperpoint h1 = iv * get_corner_position(c, (i + sd + shift) % c->type);
hyperpoint h2 = iv * get_corner_position(c, (i + sd + shift + 1) % c->type);
mi.triangles.emplace_back(make_array(C0, h1, h2), make_array(mi.M*C0, mi.M*h1, mi.M*h2));
}
}