Render current value of P and Q. Add gifs. Add build scripts.

This commit is contained in:
Joseph Ferano 2023-08-16 15:43:42 +07:00
parent aedc4e0284
commit d06856ae9c
7 changed files with 37 additions and 3 deletions

View File

@ -11,6 +11,10 @@ language.
** Showcase ** Showcase
[[file:./media/p2q5.gif]]
[[file:./media/p2q9.gif]]
[[file:./media/p3q5.gif]]
** Keybindings ** Keybindings
You can increment/decrement P or Q using the keyboard to get different geometry; You can increment/decrement P or Q using the keyboard to get different geometry;

View File

@ -81,7 +81,24 @@ update msg model =
view: Model -> Html Msg view: Model -> Html Msg
view model = 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 [ width model.winSize.width
, height model.winSize.height , height model.winSize.height
, style [ ( "display" , "block") , ( "background" , "black" ) ] ] , style [ ( "display" , "block") , ( "background" , "black" ) ] ]
@ -101,13 +118,14 @@ view model =
(Mat4.makeRotate (model.time * 0.9) (vec3 1 1 1 ) ) (Mat4.makeRotate (model.time * 0.9) (vec3 1 1 1 ) )
-- (Mat4.makeRotate (pi) (vec3 0.3 0.5 1 ) ) -- (Mat4.makeRotate (pi) (vec3 0.3 0.5 1 ) )
-- Mat4.identity -- Mat4.identity
(colorToVec3 Color.green) (colorToVec3 Color.red)
-- (colorToVec3 Color.darkGrey) -- (colorToVec3 Color.darkGrey)
-- (colorToVec3 Color.white) -- (colorToVec3 Color.white)
(vec3 1 1 1) (vec3 1 1 1)
(vec3 1 1 1) (vec3 1 1 1)
(vec3 1 1 1) (vec3 1 1 1)
1.0) ] ) 1.0)
])]
constructTorusMesh: Model -> Mesh Attributes constructTorusMesh: Model -> Mesh Attributes
constructTorusMesh model = constructTorusMesh model =

8
build.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
elm make Torus.elm
sed -i 's/<title>Torus<\/title>/<title>PQ Torus Knot<\/title>/g' index.html
mkdir -p ./public
mv index.html ./public/
cd public
zip -r ../pqtk.zip .

4
deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
scp pqtk.zip joe-vps:~
ssh joe-vps 'unzip -o pqtk.zip -d ~/websites/pqtk/ && rm pqtk.zip'

BIN
media/p2q5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 KiB

BIN
media/p2q9.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 KiB

BIN
media/p3q5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB