diff options
-rw-r--r-- | raytracer.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/raytracer.hs b/raytracer.hs index 618c708..40ff6aa 100644 --- a/raytracer.hs +++ b/raytracer.hs @@ -15,14 +15,14 @@ data Sphere = Sphere Coord Double Color deriving (Show, Eq) degrees = pi / 180 eye :: Coord -eye = (0, -20, 20) +eye = (-40, -60, 20) x_of (x, _, _) = x y_of (_, y, _) = y z_of (_, _, z) = z -sphere1 = Sphere (0, 80, 5) 10 (55,255,0) -sphere2 = Sphere (80, 0, 5) 20 (255,60,0) +sphere1 = Sphere (0, 80, 25) 10 (55,255,0) +sphere2 = Sphere (80, 0, 35) 20 (255,60,200) --sphere3 = Sphere (0, -80, 5) 20 (5,60,200) --sphere4 = Sphere (-80, 0, 5) 20 (0,255,255) --spheres = [sphere1, sphere2, sphere3, sphere4] @@ -31,7 +31,8 @@ sphere2 = Sphere (80, 0, 5) 20 (255,60,0) filename num = "foo/foo" ++ show num ++ ".ppm" --spherepos = take 1 [0,20..] -spherepos = take 10 [0,36..] +--spherepos = take 10 [0,36..] +spherepos = [36] spheres num = [ trace ("Sphere at " ++ show (round (80 * sin(num * degrees))) ++ "," ++ @@ -46,18 +47,18 @@ writenum num = trace ("Rendering " ++ show (filename $ round num)) main = mapM writenum spherepos -alpha1 = 0 * degrees -alpha2 = 360 * degrees +alpha1 = 100 * degrees +alpha2 = 0 * degrees beta1 = 70 * degrees -beta2 = 180 * degrees +beta2 = 120 * degrees floorscale = 4 -w = 500 -h = 200 +w = 400 +h = 220 -oversampling = 1 -- each pixel is 2x2 rays +oversampling = 1 -- each pixel is oversampling^2 rays black :: Color black = (0,0,0) |