Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for running the project locally #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# Endless City 🏢
WebGL city scene heavily inspired by https://demos.littleworkshop.fr/infinitown
## How to run
Just open https://corashina.github.io/Endless-City/

## Demo
https://corashina.github.io/Endless-City

## Running the project locally
If you just open the `index.html` file in a browser, you will get a CORS error that says something like this:

```
Access to XMLHttpRequest at 'file:///path-to-project/Endless-City/js/clusters/road.gltf'
from origin 'null' has been blocked by CORS policy: Cross origin requests are only
supported for protocol schemes: http, data, chrome, chrome-extension, https.
```

This is because browsers give different privileges and treatment to files if they’re local or on a web server.

To run this file without that error, you can test a local file out as if it were on a web server by following these steps:

```sh
cd Endless-City
python3 -m http.server 1234
```

Then navigate to http://localhost:1234 and voila!

## Features
- Map camera controls with damping
- Infinite map
- Cars

## Preview
![alt text](https://raw.githubusercontent.com/Tomasz-Zielinski/Endless-City/master/preview.png)