summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-03 21:42:41 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-03 21:42:41 +0100
commit10370eabf97f0737d6c32965e745baed6932eac7 (patch)
treee98e08f77a79adf88012c9bc3f43043889a2efb0
parentb75511d5c4455ec9c1602e8c389f9abfe6217c4c (diff)
downloadhaskell-10370eabf97f0737d6c32965e745baed6932eac7.tar.gz
haskell-10370eabf97f0737d6c32965e745baed6932eac7.tar.bz2
haskell-10370eabf97f0737d6c32965e745baed6932eac7.zip
sky continuous green
-rw-r--r--raytracer.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/raytracer.hs b/raytracer.hs
index 88b66ae..fa960f8 100644
--- a/raytracer.hs
+++ b/raytracer.hs
@@ -50,7 +50,7 @@ main = mapM writenum spherepos
alpha1 = 100 * degrees
alpha2 = 0 * degrees
-beta1 = 70 * degrees
+beta1 = 65 * degrees
beta2 = 120 * degrees
floorscale = 4
@@ -198,8 +198,9 @@ intersect_floor source (alpha, beta)
skycolor :: Coord -> Direction -> Color
skycolor source (alpha, beta) = (r,g,b)
where r = 60
- g = max 0 $ round $ (sqrt (alpha/6)) / (sqrt (90 * degrees)) * 128
+ g = max 0 $ round $ (sqrt (greenness/2)) * 64
b = max 0 $ round $ (sqrt (-beta+90*degrees)) / (sqrt (90 * degrees)) * 255
+ greenness = cos (alpha) + 1
data SphereIntersect = SphereIntersect Double Color deriving (Eq, Show) -- distance color
instance Ord SphereIntersect where