diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-27 01:04:23 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-27 01:04:23 +0100 |
commit | 0dcc32b6c7233ef4a888fee14fa57d647df531fb (patch) | |
tree | 870e7a47de5f2d0a90fc33ded4af1e804b9ad188 /testdata/editor-examples/Tetrahedron.lc | |
parent | 92f557c8e2dd5f0af5d87520786b6ed28a333973 (diff) |
cleanup MVP from editor examples
Diffstat (limited to 'testdata/editor-examples/Tetrahedron.lc')
-rw-r--r-- | testdata/editor-examples/Tetrahedron.lc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testdata/editor-examples/Tetrahedron.lc b/testdata/editor-examples/Tetrahedron.lc index 0aab3e39..cc790218 100644 --- a/testdata/editor-examples/Tetrahedron.lc +++ b/testdata/editor-examples/Tetrahedron.lc | |||
@@ -8,12 +8,15 @@ tetrahedron = | |||
8 | f x = (x + sin x + sin (1.1 * x)) `mod` 4 * 2 | 8 | f x = (x + sin x + sin (1.1 * x)) `mod` 4 * 2 |
9 | 9 | ||
10 | makeFrame (time :: Float) | 10 | makeFrame (time :: Float) |
11 | (projmat :: Mat 4 4 Float) | ||
12 | (vertexstream :: PrimitiveStream Triangle ((Vec 4 Float))) | 11 | (vertexstream :: PrimitiveStream Triangle ((Vec 4 Float))) |
13 | 12 | ||
14 | = imageFrame (emptyDepthImage 1, emptyColorImage navy) | 13 | = imageFrame (emptyDepthImage 1, emptyColorImage navy) |
15 | `overlay` accumulablefragments | 14 | `overlay` accumulablefragments |
16 | where | 15 | where |
16 | projmat = perspective 0.1 100.0 (30 * pi / 180) 1.0 | ||
17 | .*. lookat (V3 3.0 1.3 0.3) (V3 0.0 0.0 0.0) (V3 0.0 1.0 0.0) | ||
18 | .*. rotMatrixY (pi / 24.0 * time) | ||
19 | |||
17 | accumulablefragments | 20 | accumulablefragments |
18 | = vertexstream | 21 | = vertexstream |
19 | & mapPrimitives (\((x)) -> (scale 0.5 (projmat *. x), x)) | 22 | & mapPrimitives (\((x)) -> (scale 0.5 (projmat *. x), x)) |
@@ -24,7 +27,6 @@ makeFrame (time :: Float) | |||
24 | 27 | ||
25 | main = renderFrame $ | 28 | main = renderFrame $ |
26 | makeFrame (Uniform "Time") | 29 | makeFrame (Uniform "Time") |
27 | (Uniform "MVP") | ||
28 | tetrahedronStream | 30 | tetrahedronStream |
29 | 31 | ||
30 | tetrahedronStream = fetchArrays ((map (\v -> V4 v%x v%y v%z 1) tetrahedron)) | 32 | tetrahedronStream = fetchArrays ((map (\v -> V4 v%x v%y v%z 1) tetrahedron)) |