summaryrefslogtreecommitdiff
path: root/InfinitePlane.hs
diff options
context:
space:
mode:
Diffstat (limited to 'InfinitePlane.hs')
-rw-r--r--InfinitePlane.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/InfinitePlane.hs b/InfinitePlane.hs
index 9dd3a59..f353932 100644
--- a/InfinitePlane.hs
+++ b/InfinitePlane.hs
@@ -32,6 +32,9 @@ xyplane_inf = Mesh
32 ] 32 ]
33 } 33 }
34 34
35times1000 (V4 a b c d) = V4 (f a) (f b) (f c) d where f = (* 10000.0)
36
37
35-- | This represents the xy-plane as a large triangle. This makes it easier 38-- | This represents the xy-plane as a large triangle. This makes it easier
36-- to interpolate 3d world coordinates in the fragment. 39-- to interpolate 3d world coordinates in the fragment.
37xyplane :: LambdaCubeGL.Mesh 40xyplane :: LambdaCubeGL.Mesh
@@ -45,5 +48,18 @@ xyplane = Mesh
45 [ 0, 1, 2 48 [ 0, 1, 2
46 ] 49 ]
47 } 50 }
48 where times1000 (V4 a b c d) = V4 (f a) (f b) (f c) d where f = (* 10000.0) 51
52-- | This represents the xz-plane as a large triangle. This makes it easier
53-- to interpolate 3d world coordinates in the fragment.
54xzplane :: LambdaCubeGL.Mesh
55xzplane = Mesh
56 { mAttributes = Map.singleton "position" $ A_V4F $ V.fromList $ map times1000
57 [ V4 0 0 1 1
58 , V4 (1/sqrt 2) 0 ((-1)/sqrt 2) 1
59 , V4 ((-1)/sqrt 2) 0 ((-1)/sqrt 2) 1
60 ]
61 , mPrimitive = P_TrianglesI $ V.fromList
62 [ 0, 1, 2
63 ]
64 }
49 65