Quick way to add stars to your A-Frame project
Basic Usage
Getting started is easy, just import A-Frame and Star-System:
If things get bogged down, you may try less particles (stars):
But you also might want to try more:
Or offset the sphere of stars:
If for some reason square stars bother you, you can use a custom image to replace the stars:
Demo
Demo code:
Properties
The way this works is it creates a bunch of particles (stars) in THREE. The particles are randomly placed between two spheres: sphere of radius 'radius' and sphere of radius 'radius + depth'. You can also load a custom sprite to replace the squares that THREE.PointsMaterial() makes.
Property | Type | Default | Description |
---|---|---|---|
color | String | '#FFF' | Color of the star particles |
radius | Number | 300 | Distance from center of sphere to inner star sphere |
depth | Number | 300 | Distance between inner sphere and outer sphere |
size | Number | 1 | Size of each individual star |
count | Number | 10000 | Number of total stars created |
texture | Asset | '' | Sprite used for individual stars (ex: PNG image) |