… | |
… | |
536 | template class frac_gen<vec2d>; |
536 | template class frac_gen<vec2d>; |
537 | template class frac_gen<vec3d>; |
537 | template class frac_gen<vec3d>; |
538 | |
538 | |
539 | ///////////////////////////////////////////////////////////////////////////// |
539 | ///////////////////////////////////////////////////////////////////////////// |
540 | |
540 | |
541 | #if 0 |
541 | void noise_test (); |
542 | void hack(); void hack() |
542 | void noise_test () |
543 | { |
543 | { |
544 | frac_gen<vec2d> gen (0.5, 2); |
544 | frac_gen<vec2d> gen (0.5, 1.9); |
545 | frac_gen<vec3d> gen3; |
545 | frac_gen<vec3d> gen3; |
546 | |
546 | |
547 | #if 0 |
547 | #if 1 |
548 | int N = 1024; |
548 | int N = 1024; |
549 | |
549 | |
550 | printf ("P5 %d %d 255\n", N, N); |
550 | printf ("P5 %d %d 255\n", N, N); |
551 | // pmake&&server/deliantra-server >x&&convert -depth 8 -size 512xx512 gray:x x.ppm&& cv x.ppm |
551 | // pmake&&server/deliantra-server >x&&convert -depth 8 -size 512xx512 gray:x x.ppm&& cv x.ppm |
552 | for (int y = 0; y < N; ++y) |
552 | for (int y = 0; y < N; ++y) |
… | |
… | |
555 | for (int x = 0; x < N; ++x) |
555 | for (int x = 0; x < N; ++x) |
556 | { |
556 | { |
557 | //putc (127 * n.noise (x * 0.1, y * 0.1, 0, 0,0,1) + 128, stdout); |
557 | //putc (127 * n.noise (x * 0.1, y * 0.1, 0, 0,0,1) + 128, stdout); |
558 | //putc (256 * gen.terrain2 (x * 0.004, y * 0.004, 8), stdout); |
558 | //putc (256 * gen.terrain2 (x * 0.004, y * 0.004, 8), stdout); |
559 | //putc (256 * gen.fBm (x * 0.01, y * 0.01, 3), stdout); |
559 | //putc (256 * gen.fBm (x * 0.01, y * 0.01, 3), stdout); |
560 | //putc (256 * gen.turbulence (x * 0.004 - 1, y * 0.004 - 1, 8), stdout); |
560 | putc (256 * gen.turbulence (vec2d (x * 0.004 - 1, y * 0.004 - 1), 8), stdout); |
561 | //putc (256 * gen.heterofractal (x * 0.008, y * 0.008, 8, 0.9), stdout); |
561 | //putc (256 * gen.heterofractal (x * 0.008, y * 0.008, 8, 0.9), stdout); |
562 | |
562 | |
563 | // mountais or somesuch(?) |
563 | // mountais or somesuch(?) |
564 | //putc (256 * gen.hybridfractal (x * 0.01, y * 0.01, 8, -.4, -4), stdout); |
564 | //putc (256 * gen.hybridfractal (x * 0.01, y * 0.01, 8, -.4, -4), stdout); |
565 | |
565 | |
566 | // temperature |
566 | // temperature |
567 | //putc (256 * gen.fBm (x * 0.002, y * 0.002, 2), stdout); |
567 | //putc (256 * gen.fBm (x * 0.002, y * 0.002, 2), stdout); |
568 | // rain |
568 | // rain |
|
|
569 | |
|
|
570 | //cells |
569 | //putc (256 * gen.ridgedmultifractal (x * 0.01, y * 0.01, 3, 1.03, 2), stdout); |
571 | //putc (256 * gen.ridgedmultifractal (vec2d (x * 0.01, y * 0.01), 3, 0.5 + gen.noise(vec2d(x*0.01,y*0.01)), 2), stdout); |
570 | } |
572 | } |
571 | } |
573 | } |
572 | #else |
574 | #else |
573 | int N = 512; |
575 | int N = 512; |
574 | |
576 | |
… | |
… | |
610 | } |
612 | } |
611 | #endif |
613 | #endif |
612 | |
614 | |
613 | exit (0); |
615 | exit (0); |
614 | } |
616 | } |
615 | #endif |
|
|