module Diagrams.ThreeD.Light where
import Data.Colour
import Data.Monoid
import Data.Typeable
import Diagrams.Core
import Diagrams.ThreeD.Types
import Diagrams.ThreeD.Vector
data PointLight = PointLight P3 (Colour Double)
deriving Typeable
data ParallelLight = ParallelLight R3 (Colour Double)
deriving Typeable
type instance V PointLight = R3
type instance V ParallelLight = R3
instance Transformable PointLight where
transform t (PointLight p c) = PointLight (transform t p) c
instance Transformable ParallelLight where
transform t (ParallelLight v c) = ParallelLight (transform t v) c
instance IsPrim PointLight
instance IsPrim ParallelLight
pointLight :: (Backend b R3, Renderable PointLight b)
=> Colour Double
-> Diagram b R3
pointLight c = mkQD (Prim $ PointLight origin c) mempty mempty mempty
(Query . const . Any $ False)
parallelLight :: (Direction d, Backend b R3, Renderable ParallelLight b)
=> d
-> Colour Double
-> Diagram b R3
parallelLight d c = mkQD (Prim $ ParallelLight (fromDirection d) c)
mempty mempty mempty (Query . const . Any $ False)