Installed

elm/browser
1.0.2
elm/core
1.0.5
elm/html
1.0.0
elm-explorations/linear-algebra
1.0.3
elm-explorations/webgl
1.1.3

Registry

elm/http
2.0.0
elm/random
1.0.0
elm/time
1.0.0
elm/file
1.0.5
elm/json
1.1.3
elm/svg
1.0.1
evancz/elm-playground
1.0.3
w0rm/elm-physics
5.1.3
rtfeldman/elm-css
18.0.0
mdgriffith/elm-ui
1.1.8
​x
face : Vec3 -> Vec3 -> Vec3 -> Vec3 -> Vec3 -> List ( Vertex, Vertex, Vertex )
 
1
-- Render a spinning cube.
2
--
3
-- Dependencies:
4
--   elm install elm-explorations/linear-algebra
5
--   elm install elm-explorations/webgl
6
--
7
​
8
import Browser
9
import Browser.Events as E
10
import Html exposing (Html)
11
import Html.Attributes exposing (width, height, style)
12
import Math.Matrix4 as Mat4 exposing (Mat4)
13
import Math.Vector3 as Vec3 exposing (Vec3, vec3)
14
import WebGL
15
​
16
​
17
​
18
-- MAIN
19
​
20
​
21
main =
22
  Browser.element
23
    { init = init
24
    , view = view
25
    , update = update
26
    , subscriptions = subscriptions
27
    }
28
​
29
​
30
​
31
-- MODEL
32
​
33
​
34
type alias Model =
35
  Float
36
​
37
​
38
init : () -> (Model, Cmd Msg)
39
init () =
40
  ( 0, Cmd.none )
41
​
42
​
43
​
44
-- UPDATE
45
​
46
​
47
type Msg
48
  = TimeDelta Float
49
​