Working element buffer object

This commit is contained in:
2021-09-20 12:36:35 +01:00
parent c605ac74ff
commit 5cbcbec101
22 changed files with 242 additions and 212 deletions
+6 -8
View File
@@ -8,19 +8,17 @@ import ShapePicture.Data
import Picture
import Geometry
import Data.Bifunctor
emptyBlank :: SPic
emptyBlank = SPic emptySH blank
emptyBlank = (emptySH,blank)
translateSPf :: Float -> Float -> SPic -> SPic
translateSPf x y (SPic sh pic) = SPic
(translateSH (V3 x y 0) sh)
(translate x y pic)
translateSPf x y = bimap (translateSH (V3 x y 0)) (translate x y)
-- TODO make this uniform: currently the shape translates and the picture is set to a constant
translateSPz :: Float -> SPic -> SPic
translateSPz z (SPic sh pic) = SPic
(translateSH (V3 0 0 z) sh)
(setDepth z pic)
translateSPz z = bimap (translateSH (V3 0 0 z)) (setDepth z)
rotateSP :: Float -> SPic -> SPic
rotateSP a (SPic sh pic) = SPic (rotateSH a sh) (rotate a pic)
rotateSP a = bimap (rotateSH a) (rotate a)