summaryrefslogtreecommitdiff
path: root/hello_obj2.lc
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-05-25 20:01:35 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-25 20:01:35 -0400
commit27aa69522ca3da4fe04f996eb87a13e295db0f9f (patch)
tree12d08ea5b702b94753c1cfbd5fb18099a00368e5 /hello_obj2.lc
parent786e58ccbb05ced78c5421b53fbc469971d7db82 (diff)
Attempt to detect sharp-turns.
Diffstat (limited to 'hello_obj2.lc')
-rw-r--r--hello_obj2.lc9
1 files changed, 7 insertions, 2 deletions
diff --git a/hello_obj2.lc b/hello_obj2.lc
index 72a87ee..7b3d4a2 100644
--- a/hello_obj2.lc
+++ b/hello_obj2.lc
@@ -48,7 +48,12 @@ makeFrame (cubemap :: TextureCube)
48 `overlay` 48 `overlay`
49 points 49 points
50 & mapPrimitives (\(p,c) -> let p' = coordmap cam $ point p 50 & mapPrimitives (\(p,c) -> let p' = coordmap cam $ point p
51 in (p', point c)) 51 w = p'%w
52 yellowish = normalize c `dot` V3 1 1 0
53 p2 = if yellowish >= 0.9*sqrt 2
54 then V4 p'%x p'%y 0.1 w
55 else V4 p'%x p'%y 0.11 w
56 in (p2, point c))
52 57
53 & renderPoints cam 58 & renderPoints cam
54 59
@@ -61,7 +66,7 @@ renderPoints cam points =
61 points 66 points
62 & rasterizePrimitives (PointCtx (PointSize 5.0) 1.0 LowerLeft) ((Flat)) 67 & rasterizePrimitives (PointCtx (PointSize 5.0) 1.0 LowerLeft) ((Flat))
63 & mapFragments (\((c)) -> ((c))) 68 & mapFragments (\((c)) -> ((c)))
64 & accumulateWith (DepthOp Always False, ColorOp NoBlending (V4 True True True True)) 69 & accumulateWith (DepthOp Less True, ColorOp NoBlending (V4 True True True True))
65 70
66main :: Output 71main :: Output
67main = renderFrame $ 72main = renderFrame $