https://github.com/brahmlower/test-galaxy-map
A naive method of generating solar system coordinates in a 2D spiral galaxy, following this research: https://arxiv.org/pdf/0908.0892.pdf
https://github.com/brahmlower/test-galaxy-map
Last synced: over 1 year ago
JSON representation
A naive method of generating solar system coordinates in a 2D spiral galaxy, following this research: https://arxiv.org/pdf/0908.0892.pdf
- Host: GitHub
- URL: https://github.com/brahmlower/test-galaxy-map
- Owner: brahmlower
- Created: 2020-09-18T08:50:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-09T09:26:00.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T17:12:14.951Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Test Galaxy Map
This is a super simple project for generating galaxy maps suitable for a 2D game. No efforts have been made to make the generation process efficient, and tweaking generation settings must be done by manually editing constants in the js file.
### Configurables
#### Canvas Configs
* `width`: width of the canvas. Needs to be kept in sync with element width declared in the html
* `height`: height of the canvas. Needs to be kept in sync with element height declared in the html
#### Rendering Configs
* `RENDER_AXIS`: enable/disable rendering of the x and y axis
* `RENDER_ARMS`: enable/disable rendering of the galaxy arm guidelines
* `RENDER_CLUSTERS`: enable/disable rendering star cluster borders
* `RENDER_STARS`: enable/disable rendering of all stars
* `RENDER_STARS_ARM`: enable/disable rendering of filler stars in the arms (does not effect cluster stars)
* `RENDER_STARS_GENERAL`: enable/disable rendering of the stars between the galaxy arms
#### Star Density Configs
Density values here represent N/1000 stars/pixel for a given region. Finding a comfortable balance here is very much a manual effort.
* `MIN_STAR_DISTANCE`: Minimum number of pixels between any two stars
* `STAR_DENSITY_GENERAL`: Star density for stars between arms of the galaxy
* `STAR_DENSITY_ARM`: Star dentity for stars in the galaxy arms, but not in the star clusters
* `STAR_DENSITY_CLUSTER_MIN`: Minimum boundry for star cluster density
* `STAR_DENSITY_CLUSTER_MAX`: Maximum boundry for star cluster density
### Images
The following are a couple examples of the resulting maps.
This first image is with the default settings

This second image is with cluster density significantly increased
