Hi, I came upon this awesome video by Sebastian Lague and was wondering how to do it in Houdini. In short, he makes a solar system sim by implementing the universal law of gravitation in code. I want to replicate the two planets "dancing" at the beginning.
I'm pretty new so please forgive me if my methods are noobie.
1. The first thing I tried was copying the code into an attribute wrangle but got stuck on how to mimic the loops he makes by each timestep to update the velocity and position.
2. Then I though it would be easier with POPs, and indeed just by using "pop axis force" one particle orbit was easily simulated. But I again got stuck when trying to do it with two particles, as I want to feedback each planet (particle) position so it can update the "pop axis force" 's centroid (this failed as the centroid is determined before the solver, so it doesn't update). Maybe looping by for each timestep? merging solvers? I'm lost and going nuts hahah.
How would you approach this? Thanks in advance!!
(Btw check Sebastian Lague channel, I'm pretty sure if you use Houdini you'll like what he makes.)