Implement foreground correctly, not with shadows though

This commit is contained in:
jgk
2021-06-10 13:53:03 +02:00
parent 21a4393ad9
commit aa30f6b969
7 changed files with 34 additions and 74 deletions
+9 -2
View File
@@ -1,12 +1,19 @@
module MatrixHelper
where
( perspectiveMatrix
) where
import Geometry
import Linear.Matrix
import Linear.V4
import Graphics.Rendering.OpenGL (GLfloat)
perspectiveMatrix :: Float -> Float -> Point2 -> Point2 -> Point2 -> [GLfloat]
perspectiveMatrix
:: Float -- ^ Rotation
-> Float -- ^ Zoom
-> Point2 -- ^ Translation
-> Point2 -- ^ Window size
-> Point2 -- ^ View froms
-> [GLfloat]
perspectiveMatrix rot zoom (tranx,trany) (winx,winy) (viewFromx,viewFromy) =
let scalMat = Linear.Matrix.transpose $ V4
(V4 (2*zoom/winx) 0 0 (0::GLfloat))