summaryrefslogtreecommitdiff
path: root/mainObj.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-04-22 03:45:01 -0400
committerJoe Crayne <joe@jerkface.net>2019-04-22 03:45:09 -0400
commita5be1222b3522dd9e58a10dfb4d3210970faab02 (patch)
treecf5caeea51a0a1c5b816426f3828a1b4e8eecd8b /mainObj.hs
parentac89ee199abfe893b03cdbb89a426cd0594e06c9 (diff)
Use 3x3 rotation matrices instead of 4x4.
Diffstat (limited to 'mainObj.hs')
-rw-r--r--mainObj.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/mainObj.hs b/mainObj.hs
index caa4fa4..9792ff6 100644
--- a/mainObj.hs
+++ b/mainObj.hs
@@ -13,7 +13,6 @@ import Data.Text (Text)
13import Data.Map.Strict (Map) 13import Data.Map.Strict (Map)
14import qualified Data.Map.Strict as Map 14import qualified Data.Map.Strict as Map
15import qualified Data.Vector as V 15import qualified Data.Vector as V
16import Data.Vector.Generic as VG (init,snoc)
17import GI.Gdk.Objects 16import GI.Gdk.Objects
18import GI.GLib.Constants 17import GI.GLib.Constants
19import GI.Gtk as Gtk hiding (main) 18import GI.Gtk as Gtk hiding (main)
@@ -82,8 +81,8 @@ setUniforms gl storage st = do
82 roZ = rotMatrixZ (-tf) 81 roZ = rotMatrixZ (-tf)
83 roX = rotMatrixX (-tf) 82 roX = rotMatrixX (-tf)
84 ro = roZ <> roX 83 ro = roZ <> roX
85 pos = VG.init (ro #> fromList [0,0,10,0]) 84 pos = ro #> fromList [0,0,10]
86 up = VG.init (ro #> fromList [0,1,0,0]) 85 up = ro #> fromList [0,1,0]
87 cam = lookat pos 0 up 86 cam = lookat pos 0 up
88 LC.updateUniforms storage $ do 87 LC.updateUniforms storage $ do
89 "cam" @= return (cam :: Matrix Float) 88 "cam" @= return (cam :: Matrix Float)