add triangles
This commit is contained in:
parent
0ebe818007
commit
925359acc3
1 changed files with 18 additions and 1 deletions
19
src/Init.hs
19
src/Init.hs
|
@ -138,9 +138,26 @@ initScene = do
|
||||||
, objectMaterial = "defaultMesh"
|
, objectMaterial = "defaultMesh"
|
||||||
, objectMatrix = identity
|
, objectMatrix = identity
|
||||||
}
|
}
|
||||||
|
triangles = V.concatMap
|
||||||
|
(\y ->
|
||||||
|
V.map
|
||||||
|
(\x ->
|
||||||
|
let
|
||||||
|
translationMatrix = mkTransformation (Quaternion 1 (V3 0 0 0)) (V3 x 0 y)
|
||||||
|
scaleMatrix = scaled (V4 0.2 0.2 0.2 1)
|
||||||
|
in
|
||||||
|
RenderObject
|
||||||
|
{ objectMesh = "triangle"
|
||||||
|
, objectMaterial = "defaultMesh"
|
||||||
|
, objectMatrix = translationMatrix !*! scaleMatrix
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(V.fromList [-20 .. 20])
|
||||||
|
)
|
||||||
|
(V.fromList [-20 .. 20])
|
||||||
|
|
||||||
renderableContainer <- asks renderables
|
renderableContainer <- asks renderables
|
||||||
renderableVector <- liftIO $ STM.atomically $ STM.readTMVar renderableContainer
|
renderableVector <- liftIO $ STM.atomically $ STM.readTMVar renderableContainer
|
||||||
|
|
||||||
void $ liftIO $ STM.atomically $ STM.swapTMVar renderableContainer $
|
void $ liftIO $ STM.atomically $ STM.swapTMVar renderableContainer $
|
||||||
renderableVector `V.snoc` mask
|
(renderableVector `V.snoc` mask) V.++ triangles
|
||||||
|
|
Loading…
Reference in a new issue