Jump to content
Sign in to follow this  
draxysd

Scaling force influence based on particle age

Recommended Posts

Hi everybody,

I want to have a bit of control over my simulations (in this case flip, but it would be good to have a general dop workflow).

I want to be able to apply a force based on my particle age (or in general based on a point attribute). What would be the best way to do this? I was thinking of fiddling with popwrangle. If this is the right way, do I affect the velocity or some other attribute of the points?

Thanks in advance

 

Share this post


Link to post
Share on other sites

Depending on the type of force you're after, you can make a "pop force", and affect the different parameters in there using VEXpressions if you'd like! 

for instance, to apply an upward force that increases as the particles get older...

force.y = @age * 0.1;

make sure you check the correct "VEXpressions" checkbox though. There's two in there, one for the direction and another for the noise parameters.

Share this post


Link to post
Share on other sites

Also, that's not to say you can't do similar things with POP Wrangles. You could write one, but you'd need to affect something like force or velocity .

For instance:

@force += set(0,@age*chf("mult"),0);

Would add to the force each frame the age of the particle * some multiplier value. Keep in mind @force is read automatically in DOPs by the popsolver and integrated into the sim, but if you wanted to do a similar effect in SOPs using a solver SOP, you'd need to do something like accumulate your custom force to the velocity (@v) and finally apply to the point's position (@P) (Look into Euler Integration if you're interested in that).

Edited by jamesr
  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your reply James, very insightful stuff. How about affecting standard dop forces on a per point basis. One thing that comes to mind as a workaround is to make a volume from the attribute on each frame in SOP solver and use that as a mask for the DOP Force. Not as precise but if you don't have much particle interpenetration, should work. I just have to wrap my head around how to build this.

Edited by draxysd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×