Initial Velocity Particle Simulation

   2544   1   0
User Avatar
Member
10 posts
Joined: Jan. 2017
Offline
Hello

I am trying to do a simple VEX expression for a simple particle simulation. All I want is to change the initial velocity based on its position along the line that the particles are emitting from, so points that are towards the left shoot towards the left, and points on the right shoot towards the right. I have tried multiple methods, all of them leaving me stuck up against the same wall. Here's what I've done so far.

Setup:
Creating a line with 30 points. Creating a particle emitter that emits particles from those points

Plan:
For every point on the line, calculate the X distance from the origin, take that number on a scale of 0 to 10 and remap it from -20 to 20, and then use that for the velocity (probably using a fit function)


Method 1: Adding an expression to the X value of the Velocity in the POP source node
This doesn't seem to work because I can't change the velocity for each point that's on the line. $PT or $PTX were my initial attempts, but they give errors

Method 2: Creating a POP VOP, doing my calculations in there, and using a bindexport
This is a problem because to my knowledge, I can't plug the resulting attribute upstream into the POP Source node.

Method 3: Creating a pop velocity node and using vex to change the x value based on the distance from the origin
This is an issue because simply saying “@vx = @pointx” gives a “Read-only expression on left side of the assignment” error. Referencing the attribute I created in the POP VOP seems impossible as well.


I feel like I'm one keystroke away from the solution and I can't seem to find it. I've uploaded my file in case that's more helpful
Edited by jderry2019 - June 20, 2018 12:05:09

Attachments:
Simulation.png (1.5 MB)
splash_test.hipnc (454.6 KB)

User Avatar
Member
2034 posts
Joined: Sept. 2015
Offline
Just play with the ramps to get what you want.

There are better ways than this…pretty sure can be all done in solver itself…but I don't have much experience with that.

Attachments:
splash_test.hipnc (463.2 KB)

  • Quick Links