hunar4321 / particle-life

A simple program to simulate artificial life using attraction/reuplsion forces between many particles
MIT License
2.93k stars 291 forks source link

Basic 3D Version #40

Closed dangarfield closed 1 year ago

dangarfield commented 1 year ago

Small experimental attempt at a 3d version, I'll leave the existing 2d one untouched. It seems interesting, although not as clear to find patterns, it does use webgl based tools though, so rendering is much faster, there are plenty of optimisations.

Preview: ezgif com-gif-maker (1)

AnasQiblawi commented 1 year ago

it's escalating so fast 😂 love what you doing man 🚀

AnasQiblawi commented 1 year ago

Can you add a slider option to adjust the dimensions in the drawings section in GUI? Sometimes I tend to squeeze the atoms into a smaller space to increase the interaction between them.

dangarfield commented 1 year ago

Good point, added.

hunar4321 commented 1 year ago

Wow!

dangarfield commented 1 year ago

Actually, @AnasQiblawi is really right, if you change the dimensions, everything is a lot better. I'll open another brief PR to change the defaults.

AnasQiblawi commented 1 year ago

Decreasing atom count and dimensions is also beneficial when you desire greater FPS and performance while still getting interesting formations at the same time, especially for weak devices.

dangarfield commented 1 year ago

I agree @AnasQiblawi , but the vast majority of processing time is as a result of the distance calculations, and specifically this 'bug' (https://github.com/hunar4321/particle-life/issues/18) which is what (I feel) gives this project a lot of it's natural characteristics. I might have another look to see how it can be applied better for better parallel processing.