diff --git a/src/Scene/Renderer.hs b/src/Scene/Renderer.hs index af69bd2..fff1aeb 100644 --- a/src/Scene/Renderer.hs +++ b/src/Scene/Renderer.hs @@ -205,9 +205,10 @@ intersect r@(Ray ro rd) m@(M (Mesh s _ v f vn fn b)) = case catMaybes . elems $ det2 = det2v ^. _x >= 0 && det2v ^. _y >= 0 && det2v ^. _x + det2v ^. _y <= 1 vns = normalize $ - (0.5 - sqrt ((sqr (det2v ^. _x) + sqr (det2v ^. _y))/2)) *^ (vnorm IM.! w1) - + ((det2v ^. _y)/2) *^ (vnorm IM.! w2) - + ((det2v ^. _x)/2) *^ (vnorm IM.! w3) + --(0.5 - sqrt ((sqr (det2v ^. _x) + sqr (det2v ^. _y))/2)) *^ (vnorm IM.! w1) + (1 - det2v ^. _x - det2v ^. _y) *^ (vnorm IM.! w1) + + ((det2v ^. _x)/2) *^ (vnorm IM.! w2) + + ((det2v ^. _y)/2) *^ (vnorm IM.! w3) sqr = \x -> x * x