Files
loop/src/ShapePicture.hs
T

39 lines
748 B
Haskell

module ShapePicture
( emptyBlank
, translateSPf
, translateSPz
, rotateSP
, SPic
, noPic
, _spShape
, _spPicture
)
where
import Shape
import Picture
import Geometry
import Data.Bifunctor
type SPic = (Shape, Picture)
noPic :: Shape -> SPic
noPic sh = (sh,mempty)
_spShape :: SPic -> Shape
_spShape = fst
_spPicture :: SPic -> Picture
_spPicture = snd
emptyBlank :: SPic
emptyBlank = (emptySH,blank)
translateSPf :: Float -> Float -> SPic -> SPic
translateSPf x y = bimap (translateSH (V3 x y 0)) (translate x y)
translateSPz :: Float -> SPic -> SPic
translateSPz z = bimap (translateSH (V3 0 0 z)) (translate3 (V3 0 0 z))
rotateSP :: Float -> SPic -> SPic
rotateSP a = bimap (rotateSH a) (rotate a)