diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-07-10 21:36:45 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-07-10 21:36:45 +0200 |
commit | 4fdb61a6839e277cefde7c8332a8762e4989e72c (patch) | |
tree | 3145cd7ea0bedf5efd743b69d1a30f8f45328a8c | |
parent | 1bd1ad8fda7510290558909efbde32095776026c (diff) | |
download | pucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.tar.gz pucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.tar.bz2 pucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.zip |
Randomize color, color_speed and ppu
-rw-r--r-- | genome.c | 4 | ||||
-rw-r--r-- | main.c | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -264,7 +264,9 @@ void xform_rand (flam3_xform * const xform, const bool add_post, assert (rc != NULL); /* XXX: the original code alternates between 0/1 for every xform */ - xform->color = rand_bool (rc) ? 1.0 : 0.0; + xform->color = rand_d01 (rc); + /* … and uses a constant color_speed of 0.5 */ + xform->color_speed = rand_d01 (rc); for (unsigned int j = 0; j < 3; j++) { for (unsigned int k = 0; k < 2; k++) { @@ -238,7 +238,8 @@ static void adjust_bounding_box (flam3_genome * const genome, randctx * const rc genome->center[0] = mix0 * bmin[0] + (1-mix0)*bmax[0]; genome->center[1] = mix1 * bmin[1] + (1-mix1)*bmax[1]; } - genome->pixels_per_unit = genome->width / (bmax[0] - bmin[0]); + const double zoomin = rand_d01 (rc) * 5; + genome->pixels_per_unit = genome->width / (bmax[0] - bmin[0]) * zoomin; } static void do_random (const random_arguments * const arguments) { @@ -272,7 +273,6 @@ static void do_random (const random_arguments * const arguments) { const bool add_post = rand_d01 (&rc) < arguments->post_likelihood; xform_rand (xform, add_post, arguments->max_var, &rc); xform->density = 1.0 / nxforms; - xform->color_speed = 0.5; xform->animate = 1.0; } |