Visit a procedurally generated city, different each time. Sit back and enjoy the ride!
https://www.joelstrait.com/citytour/
Made using three.js and WebGL.
First, blueprints of the world are generated:
- A terrain map
- A road network that follows the terrain
- Empty building lots along roads
- Buildings in the lots
The results are different each time due to random variation, but follow configurable rules.
Next, this abstract definition is turned into a 3D model that can be rendered with WebGL, with the help of three.js.
Once this is all created, you can move around the city using touch gestures (mobile) or the mouse (desktop). Navigation works similar to Google/Apple Maps. You can also click the "Take a Tour" button to go on an automatic flight/drive through the city.
city_tour.html
requirescity_tour.js
, which is a minified and concatenated build of the source files. It's not included in this repo. You'll need to generate it locally by runningyarn install
(if this is your first build) and thenyarn run build
. Opencity_tour.html
in your browser and you should be good to go!- To automatically re-build when a source file changes:
- Install the
rb-fsevent
Ruby gem:gem install rb-fsevent
- Run
ruby build.rb --watch
. Each time a file under/src
changes,yarn run build
will automatically be run.
- Install the
- To run the tests, open
spec/SpecRunner.html
in your browser