an imagecabal build && ./raytrace && eog out.png

This commit is contained in:
Nicole Dresselhaus 2014-10-23 18:54:03 +02:00
parent 9205c91cc7
commit 494c03f988

View File

@ -84,7 +84,7 @@ render w h s index = case pcolls of
(Background (V3 br bg bb)) = sceneBackground s
pcolls = map fromJust $ filter isJust $ (intersect ray) <$> (sceneObjects s)
(Collision pos _ coll) = foldl1 min pcolls
ray = Ray (center cam) $ rotCam x y w h (eye cam) (up cam) (fovy cam)
ray = Ray (eye cam) $ rotCam x y w h (center cam) (up cam) (fovy cam)
cam = sceneCamera s
y = fromIntegral $ index `mod` w
x = fromIntegral $ index `div` w