From 841c7607ffab66d208771c220f2e6a9193112234 Mon Sep 17 00:00:00 2001 From: group1 Date: Mon, 17 Oct 2016 00:06:48 -0400 Subject: Sunrise changes --- ShowRunner.py | 2 +- fish_show.py | 4 +++- sunrise.py | 14 ++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ShowRunner.py b/ShowRunner.py index 0357efd..1ec1c87 100644 --- a/ShowRunner.py +++ b/ShowRunner.py @@ -10,7 +10,7 @@ from run import server_thread, send_queue, recv_queue def run_show(): server_thread.start() bridge = Bridge() -# SunriseShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE) + SunriseShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE) FishShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE) print "done!" diff --git a/fish_show.py b/fish_show.py index 6abf3bc..2894863 100644 --- a/fish_show.py +++ b/fish_show.py @@ -58,7 +58,9 @@ def compute_coverage(fish, x, y): min_y = min(max(y, fish.y), y + 1) max_y = max(min(y+1, fish.y + fish.height), y) coverage = (max_x - min_x) * (max_y - min_y) - return coverage * scale * fish.alpha_at(x, y) + if fish.is_diamond: + return coverage * scale + return coverage * fish.alpha_at(x, y) def pick_HSV(depth): diff --git a/sunrise.py b/sunrise.py index 4956342..fc235ed 100644 --- a/sunrise.py +++ b/sunrise.py @@ -140,12 +140,10 @@ def compute_coverage(fish, x, y): def pick_ocean_HSV(sky_brightness): """Return a random color in an appropriate interval.""" - min_hue = 236 / 360 - max_hue = 250 / 360 - min_sat = 0.25 - max_sat = 0.6 - hue = random.random() * (max_hue - min_hue) + min_hue - saturation = random.random() * (max_sat - min_sat) + min_sat + min_hue = constants.MIN_HUE + min_saturation = constants.MIN_SATURATION + hue = random.random() * (constants.MAX_HUE - min_hue) + min_hue + saturation = random.random() * (MAX_SATURATION - min_saturation) + min_saturation return color.HSV(hue, saturation, sky_brightness) @@ -161,8 +159,8 @@ def transition(start, end, step): def random_change(): """Return a random amount that a light should change each frame.""" - min_time = int(2 * FRAME_RATE) - max_time = int(6 * FRAME_RATE) + min_time = int(constants.MIN_TIME * FRAME_RATE) + max_time = int(MAX_TIME * FRAME_RATE) return 1 / random.randint(min_time, max_time) -- cgit v1.3.1