module Diagrams.ThreeD.Light where
import Data.Colour
import Data.Monoid
import Data.Typeable
import Diagrams.Core
import Diagrams.ThreeD.Types
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
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 :: (Backend b R3, Renderable ParallelLight b)
=> Direction
-> Colour Double
-> Diagram b R3
parallelLight d c = mkQD (Prim $ ParallelLight (fromDirection d) c)
mempty mempty mempty (Query . const . Any $ False)