Custom Particle System in VEX

comments 4
Featured Video Play Icon

Dobromir of Inlifethrill Designs asked us how we’d go about recreating this. And as I’m quite untalented with Houdini’s particle system, I turned to VEX to create this custom particle system in which individual particles attract each other.

EDIT: As Theo pointed out in the comments I made quite a severe coding mistake when iterating over all points for doing the physics sim.

This line in Pointwrangle2 in the solver:

for(int i = 0; i < @ptnum; i++){

should read like this:

for(int i = 0; i < @numpt; i++){

I fixed that error in this file.
Thanks Theo for pointing that out!

In this tutorial we’re going over the math and physics behind our particle system as well as the implementation of such a system in VEX.

I’m aware this might not be the fastest method of creatig such a system, so if you’ve got a more straightforward approach, we’d be thrilled if you share it!

Download Project File (.hipnc)

Download Project File – Physically implausible setup but funny results (.hipnc)

Share on FacebookTweet about this on TwitterPin on PinterestEmail this to someoneShare on LinkedInShare on Google+


  1. Theo says

    Hi, many thanks for this tutorial with the previous one on pcfind. I was just wondering, at some point for the setup of the gravitational forces, you’re running the for loop with @ptnum as max number, but you’re not using all the particle system (@numpt). Why ?

  2. Very interesting….A few weeks ago I also used newton law as inspiration in order to practice custom forces in DOPs. With the idea of simulating a galaxy and making bigger particles absorb the smaller ones.
    You can see the video here:

    But the original inspiration were the fabulous em-newton by mootzoid:

    I did limit the scope of the gravity with a pcfind, so the particle only considered the closest particles + the sun. But the mayor issue I had with my system was that the particles never gained momentum to separate themselves from the sun.
    I think theoretically 2 bodies with initial velocity should never collide, right?
    I basically solve this issue by “turning off” the gravity of the sun for a while. But I always thought there was something to polish in that formula.

    I’ve let it go, as I was mainly practicing custom forces. But the 2 body orbiting each other problem has been tempting me for a while….
    Basically I wonder how to improve the gravity force to simulate something closer to what mootzoid did. Maybe the system lacks consideration of angular momentum. (dropping ideas for a future tutorial) 😉

Leave a Reply

Your email address will not be published. Required fields are marked *