on master help sign in
better api
6ed1665John P Mayer Jr
libraries/Graphics/WebGL.elm+7−7
@@ -5,17 +5,17 @@ module Graphics.WebGL where
5-}
5-}
6
6
7import Basics (Float)
7import Basics (Float)
8−import MJS (V3)
8+import MJS (V3,M4x4)
9+import Color (Color)
9import Graphics.Element (Element)
10import Graphics.Element (Element)
10import Native.Graphics.WebGL
11import Native.Graphics.WebGL
11
12
13+type GLPoint = (V3,Color)
12−type GLTriangle = { a: V3, b: V3, c: V3 }
14+type GLTriangle = { a: GLPoint, b: GLPoint, c: GLPoint }
13−type GLColor = V3
14−type Model = [(GLColor,GLTriangle)]
15+type Model = [GLTriangle]
15
16
16−data Transform = NoTransform
17−
18−data Scene = Node Transform [Scene] | Leaf Model
17+data Scene = Node M4x4 [Scene] | Leaf Model
19
18
20glContext : Int -> Int -> Scene -> Element
19glContext : Int -> Int -> Scene -> Element
21glContext = Native.Graphics.WebGL.glContext
20glContext = Native.Graphics.WebGL.glContext
21+
libraries/MJS.elm+2−1
@@ -6,7 +6,8 @@ module MJS where
6
6
7import Native.MJS
7import Native.MJS
8
8
9−data V3 = V3
9+data V3 = Fake_V3
10+data M4x4 = Fake_M4x4
10
11
11v3 : Float -> Float -> Float -> V3
12v3 : Float -> Float -> Float -> V3
12v3 = Native.MJS.v3
13v3 = Native.MJS.v3