typpo / spacekit

Javascript library for 3D space visualizations
https://typpo.github.io/spacekit/
MIT License
521 stars 39 forks source link

Add working StaticParticles object with example #29

Closed HankG closed 4 years ago

HankG commented 4 years ago

What does the pull request do?

Implements a StaticParticles object (starting with the existing stubbed out one). This is useful for things like visualizing particle fields from Monte Carlo simulations. It also implements an example to show how it can be used and how multiple sets can be added to the same simulation.

What is the current behavior?

Static particles could be used for things like stars but not as a first class object.

How was the solution implemented (if it's not obvious)?

The existing StaticParticles object was started as a skeleton but the methods of initialization and settings were changed. I am trying to make it's initialization conform to the way other objects are initialized. For the initial MVP implementation it is using the Star's renderers and only allows one size and color for all particles. A shortcut method for creating StaticParticle objects was also added to the Simulation object

My thought is at some point color and size may be per-particle settings. Other potential new features like having the field be relative to another object, having control over transparency (with its own renderer) etc. are not implemented here either.

typpo commented 4 years ago

@HankG I've added you as a collaborator, please feel free to merge this when you are ready.