https://github.com/gbpagano/newton_cannon
Simulating newton's cannon experiment
https://github.com/gbpagano/newton_cannon
Last synced: 7 months ago
JSON representation
Simulating newton's cannon experiment
- Host: GitHub
- URL: https://github.com/gbpagano/newton_cannon
- Owner: gbPagano
- License: mit
- Created: 2023-03-22T18:55:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-24T21:20:07.000Z (over 2 years ago)
- Last Synced: 2025-01-17T21:12:22.233Z (9 months ago)
- Language: Rust
- Homepage: https://gbpagano.github.io/newton_cannon/
- Size: 27.4 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Newton's Cannon
Newton's cannonball was a thought experiment Isaac Newton used to hypothesize that the force of gravity was universal
---
https://user-images.githubusercontent.com/103840130/234119051-4e3e8d95-1c00-40a5-bf64-85e539084047.mp4## Online
You can test the app online on github pages
- https://gbpagano.github.io/newton_cannon/
## Binary
To run locally just clone the project and run it with cargo:
```bash
cargo run --release --features bevy/dynamic_linking
```## WebAssembly
To build in wasm and run in the browser first install the dependencies:
```bash
rustup target install wasm32-unknown-unknown
cargo install wasm-server-runner
```And run in with cargo:
```bash
cargo run --release --target wasm32-unknown-unknown
```Or use [Trunk](https://trunkrs.dev/) to build and bundle with js snippets and source html file
First install the dependencies:
```bash
cargo install --locked trunk wasm-bindgen-cli
```And follow the next commands:
```bash
touch index.html # put yout css configs here
trunk build --release -d wasm index.html
cp -r assets wasm/assets
```Done, run a local server in the wasm directory:
```bash
python -m http.server -d wasm
```## Usage
- Spacebar | Enter -> Create a new ball
- Arrow Keys -> Changes the initial velocity of the next ball
- Mouse -> Controls the camera