parallel linepattern is now configurable

This commit is contained in:
Zeno Rogue 2021-09-30 13:23:35 +02:00
parent 642f0899b5
commit 631469490f
2 changed files with 13 additions and 2 deletions

View File

@ -2293,6 +2293,10 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
addsaver(vid.fixed_facing_dir, "fixed facing dir", 90);
param_b(vid.fixed_yz, "fixed YZ", true);
param_b(draw_sky, "draw sky", true);
param_f(linepatterns::parallel_count, "parallel_count")
->editable(0, 24, 1, "number of parallels drawn", "", 'n');
param_f(linepatterns::parallel_max, "parallel_max")
->editable(0, 360*degree, 15*degree, "last parallel drawn", "", 'n');
param_f(vid.depth, "depth", "3D depth", 1)
->editable(0, 5, .1, "Ground level below the plane", "", 'd')
->set_extra([] {

View File

@ -2899,12 +2899,19 @@ EX namespace linepatterns {
}
)
);
EX ld parallel_count = 6;
EX ld parallel_max = 90 * degree;
EX ld parallel_length = 180 * degree;
linepattern patParallels("parallels", 0xFFFFFF00, always_available,
ATCENTER(
for(int i=-90; i<=90; i += 15) {
for(int i=-int(parallel_count); i<=parallel_count; i ++) {
ld phi = i * parallel_max / parallel_count;
ld xbase = 0;
if(!sphere) xbase = asin_auto((inverse(unshift(V)) * C0)[0]);
println(hlog, "xbase = ", xbase);
for(int j=-180; j<180; j+=15) {
for(int k=0; k<=15; k++)
curvepoint(xpush((j+k) * degree) * ypush0(i * degree));
curvepoint(xpush(xbase + (j+k) * degree) * ypush0(phi));
queuecurve(V, col, 0, PPR::LINE).V=V;
}
}