Small NodeJS & ThreeJS script created in one evening. Aiming to return an array with the position of several stars with their colors, this is generated randomly.
The script fetches the array and renders the galaxy on the client side with ThreeJS.
Viewable here
If you just want to use the generate (backend)
Install nodeJs, if not done
Install package:
npm install fs
Do a require
function of the generate.js
file in the folder /server
;
Example :
const galaxy = require('./server/generate.js');
const arrayStars = galaxy();
The function galaxy()
returns the default number of stars (12,000) if you want to change the number and other parameters do this:
const arrayStars = galaxy({nbrStar:16000}); //return array of 16000 stars
Other parameters :
-
branch : Number of branch
-
vWidth : Galaxy width variation
-
vHeitght : Galaxy height variation
-
vCore : Core variation (height and width)
If you want to use everything you just have to transfer the contents of the repository to a folder on your pc.
Install nodeJs, if not done
And install packages
npm install fs express http
Look at Utilization [1] to be able to change galaxy function settings.
Discord : WaRtrO#6293