summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-07-10 21:36:45 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-07-10 21:36:45 +0200
commit4fdb61a6839e277cefde7c8332a8762e4989e72c (patch)
tree3145cd7ea0bedf5efd743b69d1a30f8f45328a8c
parent1bd1ad8fda7510290558909efbde32095776026c (diff)
downloadpucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.tar.gz
pucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.tar.bz2
pucket-4fdb61a6839e277cefde7c8332a8762e4989e72c.zip
Randomize color, color_speed and ppu
-rw-r--r--genome.c4
-rw-r--r--main.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/genome.c b/genome.c
index 1d8a524..f4ccc8e 100644
--- a/genome.c
+++ b/genome.c
@@ -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++) {
diff --git a/main.c b/main.c
index 8bf0e6c..626bf5d 100644
--- a/main.c
+++ b/main.c
@@ -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;
}