https://github.com/willkessler/threejs-world
Snowspeeder Simulation (flying over a random landscape) as a browser extension for new tabs
https://github.com/willkessler/threejs-world
chrome-extension threejs
Last synced: 25 days ago
JSON representation
Snowspeeder Simulation (flying over a random landscape) as a browser extension for new tabs
- Host: GitHub
- URL: https://github.com/willkessler/threejs-world
- Owner: willkessler
- Created: 2017-12-06T23:15:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-06T00:53:40.000Z (almost 7 years ago)
- Last Synced: 2025-04-14T08:45:27.163Z (about 1 year ago)
- Topics: chrome-extension, threejs
- Language: JavaScript
- Homepage: https://willkessler.github.io/threejs-world/
- Size: 16.4 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Flyover Simulator

This Chrome Browser Extension simulates flying over an endless landscape, every time you pop a new browser tab.
### Instant Demo
You can visit [here](https://willkessler.github.io/threejs-world/) to see how it behaves without cloning this repo.
### Installing
Because this extension uses
[`simplex-noise.js`](https://github.com/jwagner/simplex-noise.js.git)
as a submodule, make sure you `git clone` using the `--recursive` flag
to get the submodule.
### Just trying it out to see what it looks like:
You can also just try this out with `python3 -m http.server 50001` and surf to `localhost:50001/landscape5.html` to see the effect without installing as an extension.
### What's interesting
* Inspiration was the [SnowSpeeder rescue scene](https://www.youtube.com/watch?v=3SHp96pOCzA) in _Empire Strikes Back_. Ideally we would do a real snowy landscape with rocks, but this landscape has green parts and some snowy parts. Oh well.
* Camera follows a spline so it's smoother flying over the landscape, much like the land speeders.
* The terrain maps stretch to the horizon more or less, but the far edges are obscured by fog. As you fly forward in space, the code deletes the maps behind you when generating a new map in front of you, so it appears to be "endless" terrain but we don't have to generate too much terrain at any given moment.
* Between sections of terrain, we try to smooth your motion between two splines rather than trying to line them up perfectly. This gives a bit of a "bounce" feeling sometimes, which is a bit like the snowspeeders. See `moveCamera` with an acceleration and dampener for the Y position.
### ToDo
The generation step is too slow. This could be more incremental and fit within 10ms frame rates.