Rotating randomly generated spheres

hi, I watch this video for creating an awesome portafolio
and now I want that the random stars that are generated to spin around in a circular path, I have no idea where I can start, I’ve been watching post about simulating particle systems but that doesn’t seem like the solution I want, also I achieved to make an object spin around another, here is my code:
main.js (1.6 KB)

and this is the one with the randomly generated stars:
main.js (2.0 KB)

also, I figured out that you can create the stars with the function or with a for loop
I hope some can help me to know where to start searching
Thanks :slight_smile:

Hi!
Maybe this will give you some ideas: Shift vertices of circle geometry not working - #11 by prisoner849

Sine and cosine are your friends. They’ll force the spheres to run on their orbits :slight_smile: Pure trigonometry.
Example: https://jsfiddle.net/prisoner849/aersLb0g/
Picture:

PS It’s just an option, not the ultimate solution.

1 Like

Thank you so much, tbh I’m new to this stuff so I didn’t know where to start, now my web page would look more awesome thanks to you:"3

You’re welcome :slight_smile: :beers:


this is the result