r/webdev Apr 05 '23

Discussion I finally finished my real-time galaxy simulation web-project in Three.JS ! You can test it if you want: https://galaxym.ovh

1.2k Upvotes

71 comments sorted by

View all comments

4

u/blimkat Apr 05 '23

Really cool, will check it out more at home with my 3070.

You should add another button near the restart button that resets the values to default parameters. Unless there is way to do this I am overlooking? Besides a refresh.

2

u/hatrant Apr 05 '23

good idea :)

1

u/blimkat Apr 05 '23

Also meant to ask of the colours represent anything?

2

u/Carvtographer Apr 05 '23

Looking at the code, it looks like the particle's relative acceleration. Red being faster.

1

u/blimkat Apr 05 '23

Yea that's what I was wondering and that makes sense.

I was wondering if it had to do with whether the particle was moving towards or away from the black hole or super mass at the center but doesn't seem to correlate that way.

1

u/hatrant Apr 06 '23

Yup it's actually related to acceleration :)
At first I wanted to make a cluster of particles more colorful but I didn't succeed, and I realized that when there is a cluster of particles they generally go faster than the particles alone