diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-02-18 18:34:47 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-02-19 02:50:09 +0100 |
commit | 998ae8f884f4b1d4e092ebdf3a441b97b2cf05b7 (patch) | |
tree | 6ced17ee38fa78de69b05c8765288ecabe52fb6e /testdata/Spiral.lc | |
parent | 27c8f3aeb2d13da0bec522ee8a8a98f534fa39e8 (diff) |
tuples are heterogeneous lists
Diffstat (limited to 'testdata/Spiral.lc')
-rw-r--r-- | testdata/Spiral.lc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/testdata/Spiral.lc b/testdata/Spiral.lc index 309316a0..19c08671 100644 --- a/testdata/Spiral.lc +++ b/testdata/Spiral.lc | |||
@@ -1,8 +1,8 @@ | |||
1 | vertices' = [V3 i 0.0 0.0 | i <- [(-5.0)..5.0] ] | 1 | vertices' = [V3 i 0.0 0.0 | i <- [(-5.0)..5.0] ] |
2 | 2 | ||
3 | lineVertexStream = fetchArrays Line $ concat [[v1, v2] | (v1, v2) <- pairs vertices'] | 3 | lineVertexStream = fetchArrays Line ((concat [[v1, v2] | (v1, v2) <- pairs vertices'])) |
4 | 4 | ||
5 | clear = FrameBuffer $ (DepthImage @1 1000, ColorImage @1 white) -- ... | 5 | clear = FrameBuffer (DepthImage @1 1000, ColorImage @1 white) -- ... |
6 | 6 | ||
7 | lines = LineCtx 1.0 LastVertex | 7 | lines = LineCtx 1.0 LastVertex |
8 | colorFragmentCtx = accumulationContext (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) | 8 | colorFragmentCtx = accumulationContext (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) |
@@ -11,18 +11,18 @@ m = Uniform "Mouse" :: Vec 2 Float | |||
11 | 11 | ||
12 | rasterizeWith = rasterizePrimitives | 12 | rasterizeWith = rasterizePrimitives |
13 | 13 | ||
14 | mapFragments2 s fs = accumulate colorFragmentCtx ( \a -> fs a) s clear | 14 | mapFragments2 s fs = accumulate colorFragmentCtx ( \((a)) -> ((fs a))) s clear |
15 | transform s f = mapPrimitives (\(p) -> let v = v3FToV4F p in (f v, v)) s | 15 | transform s f = mapPrimitives (\((p)) -> let v = v3FToV4F p in (f v, v)) s |
16 | 16 | ||
17 | trans :: Vec 4 Float -> Vec 4 Float | 17 | trans :: Vec 4 Float -> Vec 4 Float |
18 | trans (V4 i' _ _ _) = V4 (j *! sin i) (j *! cos i) (m%y *! i) 1.0 | 18 | trans (V4 i' _ _ _) = V4 (j * sin i) (j * cos i) (m%y * i) 1.0 |
19 | where i = 0.9 *! i' | 19 | where i = 0.9 * i' |
20 | j = exp ((m%x -! 0.5) *! i') | 20 | j = exp ((m%x - 0.5) * i') |
21 | 21 | ||
22 | rotate' v = (Uniform "MVP" :: Mat 4 4 Float) *. v | 22 | rotate' v = (Uniform "MVP" :: Mat 4 4 Float) *. v |
23 | 23 | ||
24 | main = lineVertexStream -- cube vertices | 24 | main = lineVertexStream -- cube vertices |
25 | `transform` ((scale 0.5 . rotate') . trans) -- scale them | 25 | `transform` ((scale 0.5 . rotate') . trans) -- scale them |
26 | & rasterizeWith lines Smooth -- rasterize | 26 | & rasterizeWith lines ((Smooth)) -- rasterize |
27 | `mapFragments2` id | 27 | `mapFragments2` id |
28 | & ScreenOut -- draw into screen | 28 | & ScreenOut -- draw into screen |