Zebra patterns for some of the new geometries
This commit is contained in:
parent
09681324d0
commit
8498ae7af8
9
cell.cpp
9
cell.cpp
|
@ -968,6 +968,9 @@ int zebra40(cell *c) {
|
||||||
else if(ctof(c)) return (c->master->zebraval/10);
|
else if(ctof(c)) return (c->master->zebraval/10);
|
||||||
else if(sphere) return 0;
|
else if(sphere) return 0;
|
||||||
else if(euclid) return eupattern(c);
|
else if(euclid) return eupattern(c);
|
||||||
|
else if(S3 == 4 && S7 == 6) {
|
||||||
|
return 8 + ((c->master->zebraval / 10 + c->spin(0))%2) * 2;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
int ii[3], z;
|
int ii[3], z;
|
||||||
ii[0] = (c->mov[0]->master->zebraval/10);
|
ii[0] = (c->mov[0]->master->zebraval/10);
|
||||||
|
@ -1306,12 +1309,6 @@ int getBits(cell *c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eLand getCLand(cell *c) {
|
|
||||||
int b = getBits(c);
|
|
||||||
b = (b&31) ^ (b>>5);
|
|
||||||
return land_scape[b & 31];
|
|
||||||
}
|
|
||||||
|
|
||||||
cell *heptatdir(cell *c, int d) {
|
cell *heptatdir(cell *c, int d) {
|
||||||
if(d&1) {
|
if(d&1) {
|
||||||
cell *c2 = createMov(c, d);
|
cell *c2 = createMov(c, d);
|
||||||
|
|
|
@ -3176,7 +3176,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||||
if(orig) gm = V;
|
if(orig) gm = V;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(behindsphere(V)) return;
|
// if(behindsphere(V)) return;
|
||||||
|
|
||||||
callhooks(hooks_drawcell, c, V);
|
callhooks(hooks_drawcell, c, V);
|
||||||
|
|
||||||
|
@ -3472,7 +3472,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||||
if(c->wall == waChasm) {
|
if(c->wall == waChasm) {
|
||||||
if(c->land == laZebra) fd++;
|
if(c->land == laZebra) fd++;
|
||||||
if(c->land == laHalloween && !wmblack) {
|
if(c->land == laHalloween && !wmblack) {
|
||||||
transmatrix Vdepth = mscale(V, geom3::BOTTOM);
|
transmatrix Vdepth = wmspatial ? mscale(V, geom3::BOTTOM) : V;
|
||||||
queuepolyat(Vdepth, shFloor[ct6], darkena(firecolor(ticks / 10), 0, 0xDF),
|
queuepolyat(Vdepth, shFloor[ct6], darkena(firecolor(ticks / 10), 0, 0xDF),
|
||||||
PPR_LAKEBOTTOM);
|
PPR_LAKEBOTTOM);
|
||||||
}
|
}
|
||||||
|
@ -4227,6 +4227,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||||
if(!chasmg) {
|
if(!chasmg) {
|
||||||
|
|
||||||
#define D(v) darkena(gradient(0, col, 0, v * (sphere ? spherity(V * cellrelmatrix(c,i)) : 1), 1), fd, 0xFF)
|
#define D(v) darkena(gradient(0, col, 0, v * (sphere ? spherity(V * cellrelmatrix(c,i)) : 1), 1), fd, 0xFF)
|
||||||
|
// #define D(v) darkena(col, fd, 0xFF)
|
||||||
|
|
||||||
if(sha & 1) {
|
if(sha & 1) {
|
||||||
forCellIdEx(c2, i, c) if(chasmgraph(c2))
|
forCellIdEx(c2, i, c) if(chasmgraph(c2))
|
||||||
|
@ -4254,10 +4255,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chasmg == 2 && wmspatial && sphere) {
|
if(false) if(chasmg == 2 && wmspatial && sphere) {
|
||||||
forCellIdEx(c2, i, c) if(chasmgraph(c2) == 0) {
|
forCellIdEx(c2, i, c) if(chasmgraph(c2) == 0) {
|
||||||
transmatrix V2 = V * cellrelmatrix(c, i);
|
transmatrix V2 = V * cellrelmatrix(c, i);
|
||||||
if(!behindsphere(V2)) continue;
|
// if(!behindsphere(V2)) continue;
|
||||||
bool w = isWarped(c2);
|
bool w = isWarped(c2);
|
||||||
int wcol2, fcol2;
|
int wcol2, fcol2;
|
||||||
setcolors(c2, wcol2, fcol2);
|
setcolors(c2, wcol2, fcol2);
|
||||||
|
|
5
hyper.h
5
hyper.h
|
@ -1827,6 +1827,7 @@ struct qpoly {
|
||||||
int cnt;
|
int cnt;
|
||||||
int outline;
|
int outline;
|
||||||
double minwidth;
|
double minwidth;
|
||||||
|
int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct qline {
|
struct qline {
|
||||||
|
@ -2096,3 +2097,7 @@ const char *dnameof(eWall w);
|
||||||
const char *dnameof(eItem i);
|
const char *dnameof(eItem i);
|
||||||
|
|
||||||
void runGeometryExperiments();
|
void runGeometryExperiments();
|
||||||
|
|
||||||
|
// z to close to this limit => do not draw
|
||||||
|
|
||||||
|
#define BEHIND_LIMIT 1e-6
|
||||||
|
|
|
@ -86,7 +86,7 @@ void ballmodel(hyperpoint& ret, double alpha, double d, double zl) {
|
||||||
void applymodel(hyperpoint H, hyperpoint& ret) {
|
void applymodel(hyperpoint H, hyperpoint& ret) {
|
||||||
|
|
||||||
ld tz = euclid ? (EUCSCALE+vid.alphax) : vid.alphax+H[2];
|
ld tz = euclid ? (EUCSCALE+vid.alphax) : vid.alphax+H[2];
|
||||||
if(tz < 1e-3 && tz > -1e-3) tz = 1000;
|
if(tz < BEHIND_LIMIT && tz > -BEHIND_LIMIT) tz = BEHIND_LIMIT;
|
||||||
|
|
||||||
if(pmodel == mdUnchanged) {
|
if(pmodel == mdUnchanged) {
|
||||||
for(int i=0; i<3; i++) ret[i] = H[i] / vid.radius;
|
for(int i=0; i<3; i++) ret[i] = H[i] / vid.radius;
|
||||||
|
@ -306,7 +306,7 @@ ld spherity(const hyperpoint& h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vid.alpha <= 1) {
|
if(vid.alpha <= 1) {
|
||||||
return to01(-.8, 1, h[2]);
|
return to01(-1.5, 1, h[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
47
patterns.cpp
47
patterns.cpp
|
@ -1063,6 +1063,53 @@ int zebratable6[28][3] = {
|
||||||
|
|
||||||
// rules for the emeraldvalues of heptagons.
|
// rules for the emeraldvalues of heptagons.
|
||||||
int zebra_heptagon(int parent, int dir) {
|
int zebra_heptagon(int parent, int dir) {
|
||||||
|
if(S3 == 4) {
|
||||||
|
int mm = (parent % 10 + S7 - dir) % S7;
|
||||||
|
int mv = parent / 10;
|
||||||
|
// whichbright: d&1
|
||||||
|
if(S7 == 5) switch(mm) {
|
||||||
|
case 0:
|
||||||
|
return 10 * (mv^1);
|
||||||
|
case 1:
|
||||||
|
return 10 * (mv^2) + 4;
|
||||||
|
case 2:
|
||||||
|
return 10 * (mv^4) + 3;
|
||||||
|
case 3:
|
||||||
|
return 10 * (mv^4) + 2;
|
||||||
|
case 4:
|
||||||
|
return 10 * (mv^2) + 1;
|
||||||
|
}
|
||||||
|
if(S7 == 7) switch(mm) {
|
||||||
|
case 0:
|
||||||
|
return 10 * (mv^2);
|
||||||
|
case 1:
|
||||||
|
return 10 * (mv^1) + 6;
|
||||||
|
case 2:
|
||||||
|
return 10 * (mv^2) + 5;
|
||||||
|
case 3:
|
||||||
|
return 10 * (mv^4) + 4;
|
||||||
|
case 4:
|
||||||
|
return 10 * (mv^4) + 3;
|
||||||
|
case 5:
|
||||||
|
return 10 * (mv^2) + 2;
|
||||||
|
case 6:
|
||||||
|
return 10 * (mv^1) + 1;
|
||||||
|
}
|
||||||
|
if(S7 == 6) switch(mm) {
|
||||||
|
case 0:
|
||||||
|
return 10 * (mv^2);
|
||||||
|
case 1:
|
||||||
|
return 10 * (mv^1) + 5;
|
||||||
|
case 2:
|
||||||
|
return 10 * (mv^2) + 4;
|
||||||
|
case 3:
|
||||||
|
return 10 * (mv^1) + 3;
|
||||||
|
case 4:
|
||||||
|
return 10 * (mv^2) + 2;
|
||||||
|
case 5:
|
||||||
|
return 10 * (mv^1) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(S7 == 8 && dir > 3) dir--;
|
if(S7 == 8 && dir > 3) dir--;
|
||||||
return zebratable[parent/10-4][(70+dir-(parent%10))%7];
|
return zebratable[parent/10-4][(70+dir-(parent%10))%7];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue