Working cloud shadows (slow)
This commit is contained in:
@@ -52,17 +52,28 @@ rotate3 a (V3 x y z) = V3 x' y' z
|
||||
(V2 x' y') = rotateV a (V2 x y)
|
||||
|
||||
magV3 :: Point3 -> Float
|
||||
{-# INLINE magV3 #-}
|
||||
magV3 (V3 x y z) = sqrt $ x^i + y^i + z^i
|
||||
where
|
||||
i = 2 :: Int
|
||||
|
||||
normalizeV3 :: Point3 -> Point3
|
||||
{-# INLINE normalizeV3 #-}
|
||||
normalizeV3 (V3 0 0 0) = V3 0 0 0
|
||||
normalizeV3 p = (1 / magV3 p) *.*.* p
|
||||
|
||||
addZ :: Float -> Point2 -> Point3
|
||||
{-# INLINE addZ #-}
|
||||
addZ z (V2 x y) = V3 x y z
|
||||
|
||||
stripZ :: Point3 -> Point2
|
||||
{-# INLINE stripZ #-}
|
||||
stripZ (V3 x y _) = V2 x y
|
||||
|
||||
dist3 :: Point3 -> Point3 -> Float
|
||||
{-# INLINE dist3 #-}
|
||||
dist3 !p1 !p2 = magV3 (p2 -.-.- p1)
|
||||
|
||||
orderAround3
|
||||
:: Point3 -- ^ Vector to order around
|
||||
-> [Point3]
|
||||
|
||||
Reference in New Issue
Block a user