diff options
author | Joe Crayne <joe@jerkface.net> | 2019-04-29 16:04:24 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-04-29 16:04:24 -0400 |
commit | edbc09c280c1699933c443795686394c1e9e8de5 (patch) | |
tree | 533a2849f8a9ebe4a86d3efa5dd7062c27f73b07 /InfinitePlane.hs | |
parent | 3af8c040637d4289e39577c04fc8b68f8d868f05 (diff) |
mainObj.hs: Slower animation, more straight-forward grid calculation.
Diffstat (limited to 'InfinitePlane.hs')
-rw-r--r-- | InfinitePlane.hs | 18 |
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 | ||
35 | times1000 (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. |
37 | xyplane :: LambdaCubeGL.Mesh | 40 | xyplane :: 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. | ||
54 | xzplane :: LambdaCubeGL.Mesh | ||
55 | xzplane = 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 | ||