How to create a vortex of particles with Nvidia Flex

Hi!

I’ve been trying to figure this out for a while, and I am unable to get the desired result, so I figured I should just ask here for some advice!

Basically, I’ve been trying to create a vortex of particles out of an existing particle cloud that is, by default, simply being emitted and floating around. I’ve been trying everything, from creating Forces that turn in a circle to messing with the simulation parameters such as the Vorticity ones, but it seems like I’m just unable to create that effect that way. I’m familiar with activating and deactivating forces, emitters and all to set me up so my timing is right, but for the simulation itself, I just can’t seem to get it right. Does anyone have any advice as to how I can create some sort of vortex with Nvidia Flex, or have any files/link to share with me?

Thank you so much for your help!

Hi there!

You can add arbitrary forces to the particles using the ‘Velocity Feedback TOP’ parameter in your actor (Flex page). If you use a flexTOP to fetch the velocities of the particles, you can add stuff to it and set that to the velocity feedback top. This will use your velocities instead of the simulated ones. Be careful not to update too big of changes to the velocity, since this will break the simulation.

To get a vortex force, what you can do is get the position of the particles (flexTOP set to position) then using a reorderTOP to only get the X and Z of the position (so set the green channel to zero) This will result in a vector from your particle to the center of your simulation. If you rotate that vector 90 degrees, it will point in the direction of your vortex force (circling around the center). A 2d 90-degree rotation is equal to swapping the x and z and negating one of them. Since this will definitely let your particles fly away like crazy, you may want to add an additional force towards the center and probably upwards to make it look better.

This all might not make any sense, so best to show you an example :smiley:

Hope this helps.
Cheers,
tim

FlexVortex.tox (1.7 KB)

ah forgot to mention I’m also dividing by the (squared) radius (length to the center), so the particles closer to the center get a larger force.

Hi Tim!

Thank you so much for your help, your demo in the .tox is extremely helpful. I’m struggling to navigate through it, but I’ll try to figure it out!

I notice that as I move my actor’s position in the Xform tab, the vortex effect seems to stop working. I imagine that is because it is currently being calculated from the origin point. I was wondering if there’d be a way to continue emitting particules from anywhere inside the collision box and for those particules to then be attracted by the vortex force? Anyhow, thank you so much for your help, it’s a really neat example of how to achieve this effect with the Nvidia Flex simulation.

Hi Wilay,

Yes you’re right. Right now the center of the vortex is located at 0,0,0. To move the center around you can subtract a position from the nvflex_Position. The actor position is the emitter of the particles. Right now it has strength 1, if you move it around you might not see the emission of the particles since it’s too weak, I’ve added a constant1 TOP that describes the center of the vortex. Right now linked to the actor1COMP so if you move the actor, the whole vortex is moving.

Hope this helps.
Cheers,
tim

FlexVortex_moved.tox (1.9 KB)