Bring resources back in, slow the player movement down
10
README.md
@ -6,9 +6,10 @@ The intention of this project is to learn about the intersection of 3 different
|
|||||||
topics; graphics, web, and functional programming. It uses Elm with WebGL to
|
topics; graphics, web, and functional programming. It uses Elm with WebGL to
|
||||||
create a basic 3D first-person scene implementing several lower level graphics
|
create a basic 3D first-person scene implementing several lower level graphics
|
||||||
techniques including matrix transformations to model parent/child local
|
techniques including matrix transformations to model parent/child local
|
||||||
transforms, texture mapping, and basic lighting with shaders.
|
transforms, texture mapping, and basic lighting with shaders. Consider it the
|
||||||
|
humble beginnings of a functional 3D graphics engine.
|
||||||
|
|
||||||

|
["FPS Scene"](screenshots/elm-fps.png)
|
||||||
|
|
||||||
|
|
||||||
## Update 2023
|
## Update 2023
|
||||||
@ -25,17 +26,18 @@ This project is Elm 0.18.0, so you need to have that version installed.
|
|||||||
|
|
||||||
To install the binaries manually, use
|
To install the binaries manually, use
|
||||||
- [Install Binaries](https://sirfitz.medium.com/install-elm-0-18-0-in-2021-3f64ce298801)
|
- [Install Binaries](https://sirfitz.medium.com/install-elm-0-18-0-in-2021-3f64ce298801)
|
||||||
|
|
||||||
If you want to use `npm`, you can follow this;
|
If you want to use `npm`, you can follow this;
|
||||||
- [Install with npm](https://discourse.elm-lang.org/t/downgrade-to-v18/2005/2)
|
- [Install with npm](https://discourse.elm-lang.org/t/downgrade-to-v18/2005/2)
|
||||||
|
|
||||||
Note that for the `npm`, you will likely need an older version of Node.js, so it
|
Note that for `npm`, you will likely need an older version of Node.js, so it
|
||||||
is recommended to use the [Node Version Manager
|
is recommended to use the [Node Version Manager
|
||||||
`npm`](https://github.com/nvm-sh/nvm) for that.
|
`npm`](https://github.com/nvm-sh/nvm) for that.
|
||||||
|
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
In order to be able to load the textures and models, the website most be served
|
In order to be able to load the textures and models, the website must be served
|
||||||
by an HTTP server because of browser security, see
|
by an HTTP server because of browser security, see
|
||||||
[SOP](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
|
[SOP](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
|
||||||
and [CORS](https://developer.mozilla.org/en-US/docs/Glossary/CORS) if curious.
|
and [CORS](https://developer.mozilla.org/en-US/docs/Glossary/CORS) if curious.
|
||||||
|
@ -107,7 +107,7 @@ update msg model =
|
|||||||
(model.keys.a , model.keys.s , model.keys.w , model.keys.d)
|
(model.keys.a , model.keys.s , model.keys.w , model.keys.d)
|
||||||
model.lookDir
|
model.lookDir
|
||||||
model.pos
|
model.pos
|
||||||
0.2
|
0.08
|
||||||
, robot = updateRobot model dt
|
, robot = updateRobot model dt
|
||||||
, rot = model.rot + 0.001 * dt}
|
, rot = model.rot + 0.001 * dt}
|
||||||
WindowResized size -> { model | winSize = size }
|
WindowResized size -> { model | winSize = size }
|
||||||
|
1209
models/ship.obj
Normal file
1213
models/ship2.obj
Normal file
1518
models/suz.obj
Normal file
BIN
screenshots/elm-fps.png
Normal file
After Width: | Height: | Size: 488 KiB |
15
textures/elm-package.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0",
|
||||||
|
"summary": "helpful summary of your project, less than 80 characters",
|
||||||
|
"repository": "https://github.com/user/project.git",
|
||||||
|
"license": "BSD3",
|
||||||
|
"source-directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"exposed-modules": [],
|
||||||
|
"dependencies": {
|
||||||
|
"elm-lang/core": "5.1.1 <= v < 6.0.0",
|
||||||
|
"elm-lang/html": "2.0.0 <= v < 3.0.0"
|
||||||
|
},
|
||||||
|
"elm-version": "0.18.0 <= v < 0.19.0"
|
||||||
|
}
|
BIN
textures/tetra.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
textures/tetra_texture.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
textures/thwomp-face.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
textures/thwomp-side.jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
textures/triangle_texture.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
textures/uv_big.png
Normal file
After Width: | Height: | Size: 280 KiB |
BIN
textures/uv_small.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
textures/wood-crate.jpg
Normal file
After Width: | Height: | Size: 176 KiB |