1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 17:40:36 +00:00

more configuration for meridian/parallel patterns

This commit is contained in:
Zeno Rogue 2023-03-16 14:45:11 +01:00
parent 0f9b30f51b
commit b8f916df3a
2 changed files with 23 additions and 5 deletions

View File

@ -2690,6 +2690,13 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
->editable(0, 24, 1, "number of parallels drawn", "", 'n');
param_f(linepatterns::parallel_max, "parallel_max")
->editable(0, TAU, 15*degree, "last parallel drawn", "", 'n');
param_f(linepatterns::mp_ori, "mp_ori")
->editable(0, TAU, 15*degree, "parallel/meridian orientation", "", 'n');
param_f(linepatterns::meridian_max, "meridian_max");
param_f(linepatterns::meridian_count, "meridian_count");
param_f(linepatterns::meridian_length, "meridian_length");
param_f(linepatterns::meridian_prec, "meridian_prec");
param_f(linepatterns::meridian_prec2, "meridian_prec2");
param_f(twopoint_xscale, "twopoint_xscale");
param_i(twopoint_xshape, "twopoint_xshape");

View File

@ -2963,12 +2963,23 @@ EX namespace linepatterns {
}
)
);
EX ld mp_ori = 0;
EX ld meridian_max = 180._deg;
EX ld meridian_count = 12;
EX ld meridian_length = 90._deg;
EX ld meridian_prec = 12;
EX ld meridian_prec2 = 15;
EX linepattern patMeridians = linepattern("meridians", 0xFFFFFF00, always_available,
ATCENTER(
for(int j=-180; j<=180; j+=15) {
for(int i=-90; i<90; i+=15) {
for(int k=0; k<=15; k++)
curvepoint(xpush(j * degree) * ypush0((i+k) * degree));
for(int j=0; j<meridian_count; j++) {
ld mj = meridian_max * (j * 2. / meridian_count - 1);
for(int i=0; i<meridian_prec; i++) {
for(int k=0; k<=meridian_prec2; k++) {
ld mi = i + k * 1. / meridian_prec2;
mi = mi * 2. / meridian_prec - 1;
mi *= meridian_length;
curvepoint(spin(mp_ori * degree) * xpush(mj) * ypush0(mi));
}
queuecurve(V, col, 0, PPR::LINE).V=V;
}
}
@ -2986,7 +2997,7 @@ EX namespace linepatterns {
println(hlog, "xbase = ", xbase);
for(int j=-180; j<180; j+=15) {
for(int k=0; k<=15; k++)
curvepoint(xpush(xbase + (j+k) * degree) * ypush0(phi));
curvepoint(spin(mp_ori * degree) * xpush(xbase + (j+k) * degree) * ypush0(phi));
queuecurve(V, col, 0, PPR::LINE).V=V;
}
}