fix(elm-review): eliminate all issues
This commit is contained in:
parent
f9d6147658
commit
929360cd30
1 changed files with 14 additions and 10 deletions
24
src/Main.elm
24
src/Main.elm
|
@ -1,4 +1,4 @@
|
||||||
module Main exposing (main)
|
module Main exposing (Flags, Model, Msg, Object3d, main)
|
||||||
|
|
||||||
import Angle
|
import Angle
|
||||||
import Array
|
import Array
|
||||||
|
@ -11,7 +11,7 @@ import Element exposing (..)
|
||||||
import Element.Background as Background
|
import Element.Background as Background
|
||||||
import Element.Font as Font
|
import Element.Font as Font
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Http exposing (Error)
|
import Http
|
||||||
import Length
|
import Length
|
||||||
import Obj.Decode
|
import Obj.Decode
|
||||||
import Pixels
|
import Pixels
|
||||||
|
@ -61,11 +61,6 @@ animatedEl =
|
||||||
animatedUi Element.el
|
animatedUi Element.el
|
||||||
|
|
||||||
|
|
||||||
animatedCol : Animation -> List (Element.Attribute msg) -> List (Element msg) -> Element msg
|
|
||||||
animatedCol =
|
|
||||||
animatedUi Element.column
|
|
||||||
|
|
||||||
|
|
||||||
main : Program Flags Model Msg
|
main : Program Flags Model Msg
|
||||||
main =
|
main =
|
||||||
Browser.document { init = init, update = update, subscriptions = subscribe, view = view }
|
Browser.document { init = init, update = update, subscriptions = subscribe, view = view }
|
||||||
|
@ -81,9 +76,11 @@ type alias Flags =
|
||||||
|
|
||||||
init : Flags -> ( Model, Cmd Msg )
|
init : Flags -> ( Model, Cmd Msg )
|
||||||
init flags =
|
init flags =
|
||||||
case flags of
|
let
|
||||||
( width, height ) ->
|
( width, height ) =
|
||||||
( { w = width, h = height, mesh = Nothing, textures = Nothing, angle = 0 }, Cmd.batch [ getMesh, getTexture ] )
|
flags
|
||||||
|
in
|
||||||
|
( { w = width, h = height, mesh = Nothing, textures = Nothing, angle = 0 }, Cmd.batch [ getMesh, getTexture ] )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,23 +233,29 @@ pyramidMesh : Mesh.Uniform coordinates
|
||||||
pyramidMesh =
|
pyramidMesh =
|
||||||
let
|
let
|
||||||
-- Define the vertices of our pyramid
|
-- Define the vertices of our pyramid
|
||||||
|
frontLeft : Point3d Length.Meters coordinates
|
||||||
frontLeft =
|
frontLeft =
|
||||||
Point3d.centimeters 250 500 0
|
Point3d.centimeters 250 500 0
|
||||||
|
|
||||||
|
frontRight : Point3d Length.Meters coordinates
|
||||||
frontRight =
|
frontRight =
|
||||||
Point3d.centimeters 400 0 -500
|
Point3d.centimeters 400 0 -500
|
||||||
|
|
||||||
|
backLeft : Point3d Length.Meters coordinates
|
||||||
backLeft =
|
backLeft =
|
||||||
Point3d.centimeters -250 500 -500
|
Point3d.centimeters -250 500 -500
|
||||||
|
|
||||||
|
backRight : Point3d Length.Meters coordinates
|
||||||
backRight =
|
backRight =
|
||||||
Point3d.centimeters -250 0 0
|
Point3d.centimeters -250 0 0
|
||||||
|
|
||||||
|
tip : Point3d Length.Meters coordinates
|
||||||
tip =
|
tip =
|
||||||
Point3d.centimeters 0 0 500
|
Point3d.centimeters 0 0 500
|
||||||
|
|
||||||
-- Create a TriangularMesh value from an array of vertices and list
|
-- Create a TriangularMesh value from an array of vertices and list
|
||||||
-- of index triples defining faces (see https://package.elm-lang.org/packages/ianmackenzie/elm-triangular-mesh/latest/TriangularMesh#indexed)
|
-- of index triples defining faces (see https://package.elm-lang.org/packages/ianmackenzie/elm-triangular-mesh/latest/TriangularMesh#indexed)
|
||||||
|
triangularMesh : TriangularMesh (Point3d Length.Meters coordinates)
|
||||||
triangularMesh =
|
triangularMesh =
|
||||||
TriangularMesh.indexed
|
TriangularMesh.indexed
|
||||||
(Array.fromList
|
(Array.fromList
|
||||||
|
@ -302,6 +305,7 @@ view3D model =
|
||||||
{ focalPoint = Point3d.origin
|
{ focalPoint = Point3d.origin
|
||||||
, eyePoint =
|
, eyePoint =
|
||||||
let
|
let
|
||||||
|
theta : Angle.Angle
|
||||||
theta =
|
theta =
|
||||||
Angle.degrees model.angle
|
Angle.degrees model.angle
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue