Add UI elements showing current values of P and Q

This commit is contained in:
Joseph Ferano 2023-08-18 15:51:48 +07:00
parent 84e29eb59e
commit 4cebcebfa3

View File

@ -81,10 +81,27 @@ update msg model =
view: Model -> Html Msg
view model =
WebGL.toHtml
Html.div []
[ Html.div [ style [ ("position", "absolute")
, ("top", "10px")
, ("left", "10px")
, ("background-color", "rgba(128, 128, 128, 1)")
, ("padding", "5px")
]
]
[ Html.text ("P: " ++ toString model.p) ]
, Html.div [ style [ ("position", "absolute")
, ("top", "10px")
, ("left", "40px")
, ("background-color", "rgba(128, 128, 128, 1)")
, ("padding", "5px")
]
]
[ Html.text ("Q: " ++ toString model.q) ]
, WebGL.toHtml
[ width model.winSize.width
, height model.winSize.height
, style [ ( "display" , "block") , ( "background" , "black" ) ] ]
, style [ ( "display" , "block") , ( "background" , "#151515" ) ] ]
([ WebGL.entity
diffuseVS
diffuseFS
@ -101,13 +118,15 @@ view model =
(Mat4.makeRotate (model.time * 0.9) (vec3 1 1 1 ) )
-- (Mat4.makeRotate (pi) (vec3 0.3 0.5 1 ) )
-- Mat4.identity
-- (colorToVec3 Color.red)
(colorToVec3 Color.green)
-- (colorToVec3 Color.darkGrey)
-- (colorToVec3 Color.white)
-- (colorToVec3 Color.blue)
-- (colorToVec3 Color.yellow)
(vec3 1 1 1)
(vec3 1 1 1)
(vec3 1 1 1)
1.0) ] )
1.0)
])]
constructTorusMesh: Model -> Mesh Attributes
constructTorusMesh model =