https://github.com/l1mey112/yr11-physics-applied
Year 11 Physics, Applied. A collection of interactive demonstrations and physics simulations.
https://github.com/l1mey112/yr11-physics-applied
c-programming emscripten imgui interactive physics physics-simulation sokol wasm website
Last synced: about 1 month ago
JSON representation
Year 11 Physics, Applied. A collection of interactive demonstrations and physics simulations.
- Host: GitHub
- URL: https://github.com/l1mey112/yr11-physics-applied
- Owner: l1mey112
- License: mit
- Created: 2023-03-25T14:42:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T11:08:46.000Z (almost 2 years ago)
- Last Synced: 2025-02-28T07:36:27.331Z (about 2 months ago)
- Topics: c-programming, emscripten, imgui, interactive, physics, physics-simulation, sokol, wasm, website
- Language: C
- Homepage: https://l-m.dev/physics-applied
- Size: 1.06 MB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Year 11 Physics, Applied.](https://l-m.dev/physics-applied)
Welcome! This repository is a collection of interactive demonstrations and physics simulations designed to visualise and reinforce the physics concepts I have learned in my Year 11 physics class.
Each demo will be interactive and will cover a certain noteworthy topic. They will be created as I learn the content and will be provided free of charge for everyone.
The demos included in this repository are written purely in the C programming language and use Emscripten to compile them to WebAssembly.
**Visit the page at [l-m.dev/physics-applied](https://l-m.dev/physics-applied)**
Supporting libraries [sokol](https://github.com/floooh/sokol) and [Dear ImGui](https://github.com/ocornut/imgui) are used as an abstraction layer over the specifics of the web/browser and allow me to focus on writing the demos, not hassle with the looks.
All of the code in this repository is licensed under the MIT open source license. See the LICENSE file for more details.
# Compilation
I don't like `cmake`, too complicated and not enough control. I took the existing compilation for `libsokol.a` and `libcimgui.a`, then blindly seralised it into a single `Makefile`.
Install Emscripten, this will provide `emcc`, `em++`, and `wasm-opt`.
Oh yeah, don't try this on Windows, just don't.
Call `make` to create HTML files in `public/`.
```
$ make
$ ls public
...
...
```You can also create production/optimised builds, which will insert certain CFLAGS and run more code. Call with `-j` to run builds concurrently.
```
$ make PROD=1 -j$(nproc)
```