on master help sign in
small docs
e7e6e9eJohn P Mayer Jr
libraries/Graphics/WebGL.elm+23−2
@@ -1,7 +1,28 @@
1−
2module Graphics.WebGL (mapTriangle, zipTriangle, loadTex, model, webgl) where
1module Graphics.WebGL (mapTriangle, zipTriangle, loadTex, model, webgl) where
3
2
4−{-| WebGL -}
3+{-| The WebGL API is for high performance drawing.
4+
5+# Triangle Convenience Functions
6+@docs Triangle, mapTriangle, zipTriangle
7+
8+# Shaders
9+Shaders are created using glsl blocks.
10+
11+vertex : Shader { a | pos : V3 } {} {}
12+vertex = [glsl|
13+
14+attribute vec3 pos;
15+
16+void main () {
17+ gl_Position = vec4(pos,1.0);
18+}
19+
20+|]
21+
22+# WebGL Element
23+@docs webgl
24+
25+-}
5
26
6import Graphics.Element (Element)
27import Graphics.Element (Element)
7import Http (Response)
28import Http (Response)
libraries/MJS.elm+4−5
@@ -2,9 +2,9 @@ module MJS where
2
2
3{-| MJS
3{-| MJS
4
4
5−A high performance linear algrbra library using
5+A high performance linear algebra library using
6−native JS array types. Geared towards 3D graphics
6+native JS arrays. Geared towards 3D graphics
7−and used primarily by the Graphics.WebGL.
7+and use with Graphics.WebGL.
8
8
9Both vectors and matrices are immutable.
9Both vectors and matrices are immutable.
10
10
@@ -15,6 +15,7 @@ import Native.MJS
15data V2 = V2
15data V2 = V2
16data V3 = V3
16data V3 = V3
17data V4 = V4
17data V4 = V4
18+data M4x4 = M4x4
18
19
19v3 : Float -> Float -> Float -> V3
20v3 : Float -> Float -> Float -> V3
20v3 = Native.MJS.v3
21v3 = Native.MJS.v3
@@ -53,8 +54,6 @@ dot = Native.MJS.v3dot
53cross : V3 -> V3 -> V3
54cross : V3 -> V3 -> V3
54cross = Native.MJS.v3cross
55cross = Native.MJS.v3cross
55
56
56−data M4x4 = Dummy_M4x4
57−
58mul4x4 : M4x4 -> V3 -> V3
57mul4x4 : M4x4 -> V3 -> V3
59mul4x4 = Native.MJS.v3mul4x4
58mul4x4 = Native.MJS.v3mul4x4
60
59