Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How flat 2D space bends with portals. Simulation and visualization using springs, RK4, Three.js, dat.GUI.

Notifications You must be signed in to change notification settings

lgfinfo/space_bending

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Bending

This is the code behind https://optozorax.github.io/space_bending/

How to make changes and run it locally

  1. install Rust using https://rustup.rs/
  2. cd wasm
  3. cargo install wasm-pack install the wasm builder
  4. cargo install miniserve install a webserver to serve local files
  5. wasm-pack build --target web build rust code into a wasm.js file
  6. miniserve .. host a webserver that has index.html at the root
  7. Open http://localhost:8080/index.html in your browser

When you make code changes, you can leave miniserve running, in another terminal tab re-run only wasm-pack build --target web. Then refresh your browser to see the new version.

Code architecture

  • The UI and render loop is defined in JavaScript as part of index.html
  • The Mesh creation and simulation is implemented in rust in the wasm directory.

About

How flat 2D space bends with portals. Simulation and visualization using springs, RK4, Three.js, dat.GUI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 45.1%
  • JavaScript 24.6%
  • GLSL 15.7%
  • HTML 14.6%