add view and model matrices

This commit is contained in:
nek0 2020-06-12 20:13:36 +02:00
parent dc7162e407
commit 4bc8b759a6

View file

@ -115,6 +115,9 @@ main = do
-- -- MATRICES
let proj = ortho 0 800 0 600 (-1) 1 :: M44 GL.GLfloat
view = mkTransformationMat (identity :: M33 GL.GLfloat) (V3 (-100) 0 0)
model = mkTransformationMat (identity :: M33 GL.GLfloat) (V3 200 200 0)
mvp = proj !*! view !*! model
-- -- TEXTURE
@ -139,7 +142,7 @@ main = do
-- -- tell the shader where to find the texture
bind sp
setUniform sp "u_texture" (texSlot tex)
setUniform sp "u_mvp" proj
setUniform sp "u_mvp" mvp
-- -- UNIFORMS