​x
    [ WebGL.entity vertexShader fragmentShader mesh { perspective = perspective (t / 1000) }
 
1
-- elm install elm-explorations/linear-algebra
2
-- elm install elm-explorations/webgl
3
​
4
​
5
import Browser
6
import Browser.Events as E
7
import Html exposing (Html)
8
import Html.Attributes exposing (width, height, style)
9
import Math.Matrix4 as Mat4 exposing (Mat4)
10
import Math.Vector3 as Vec3 exposing (Vec3, vec3)
11
import WebGL
12
​
13
​
14
​
15
-- MAIN
16
​
17
​
18
main =
19
  Browser.element
20
    { init = init
21
    , view = view
22
    , update = update
23
    , subscriptions = subscriptions
24
    }
25
​
26
​
27
​
28
-- MODEL
29
​
30
​
31
type alias Model =
32
  Float
33
​
34
​
35
init : () -> (Model, Cmd Msg)
36
init () =
37
  ( 0, Cmd.none )
38
​
39
​
40
​
41
-- UPDATE
42
​
43
​
44
type Msg
45
  = TimeDelta Float
46
​
47
​
48
update : Msg -> Model -> (Model, Cmd Msg)
49
update msg currentTime =