Mid strictifying

This commit is contained in:
jgk
2021-07-29 23:42:27 +02:00
parent 67aa5c05c7
commit bd8ef3f416
22 changed files with 359 additions and 325 deletions
+9 -9
View File
@@ -16,16 +16,16 @@ perspectiveMatrixb
-> Point2 -- ^ Window size
-> Point2 -- ^ View froms
-> [GLfloat]
perspectiveMatrixb rot zoom (tranx,trany) (winx,winy) (viewFromx,viewFromy) =
perspectiveMatrixb rot zoom (V2 tranx trany) (V2 winx winy) (V2 viewFromx viewFromy) =
concatMap vToL
. vToL
. lmt
$ scaleMat (2*zoom/winx,2*zoom/winy)
$ scaleMat (V2 (2*zoom/winx) (2*zoom/winy))
-- $ scaleMat (2/winx,2/winy)
!*! rotMatr (-rot)
!*! transMat (viewFromx-tranx,viewFromy-trany)
!*! transMat (V2 (viewFromx-tranx) (viewFromy-trany))
!*! perMat (zoom * 0.4)
!*! transMat (-viewFromx,-viewFromy)
!*! transMat (V2 (-viewFromx) (-viewFromy))
!*! vertScale
!*! vertTrans 20
-- !*! vertTrans 80
@@ -36,12 +36,12 @@ isoMatrix
-> Point2 -- ^ Translation
-> Point2 -- ^ Window size
-> [GLfloat]
isoMatrix rot zoom (tranx,trany) (winx,winy) = concatMap vToL
isoMatrix rot zoom (V2 tranx trany) (V2 winx winy) = concatMap vToL
. vToL
. lmt
$ scaleMat (2*zoom/winx,2*zoom/winy)
$ scaleMat (V2 (2*zoom/winx) (2*zoom/winy))
!*! rotMatr (-rot)
!*! transMat (-tranx,-trany)
!*! transMat (V2 (-tranx) (-trany))
lmt :: V4 (V4 a) -> V4 (V4 a)
lmt = Linear.Matrix.transpose
@@ -57,7 +57,7 @@ perMat x = V4
(V4 0 0 x 1)
scaleMat :: Point2 -> V4 (V4 Float)
scaleMat (x,y) = V4
scaleMat (V2 x y) = V4
(V4 x 0 0 0)
(V4 0 y 0 0)
(V4 0 0 1 0)
@@ -71,7 +71,7 @@ rotMatr a = V4
(V4 0 0 0 1)
transMat :: Point2 -> V4 (V4 Float)
transMat (x,y) = V4
transMat (V2 x y) = V4
(V4 1 0 0 x)
(V4 0 1 0 y)
(V4 0 0 1 0)