logix1390 Posted September 19, 2017 Share Posted September 19, 2017 Hello, So I have some particles flying around an animated sphere. I want these particles to slow down as it moves away from my sphere. I noticed in the preset vex expressions for drag it has a "Drag by Proximity to Point" expression. However, I am having a tough time understanding this... // Drag by Proximity to Point vector target = {0, 1, 0}; // Target position float dist = length(@P - target); // distance to target float radius = 2.0; // Effect radius dist = fit(dist, 0, radius, 0, 1); // fit to range airresist *= dist; -------- Question: vector target = {0, 1, 0}; <<<---- where exactly is this y value ? Is this y value in relation to my animated object ? How can I set my target to be the centroid of my emitter dist = fit(dist, 0, radius, 0, 1); <<<---- how is the distance and radius related in regard to a fit function ? I'm wondering if there is any easier way to get my particles to slow down as it moves away from my emitter and almost look like it is following my object. I know a pop attract will work, but it takes a while to get the correct settings.. Thank you Quote Link to comment Share on other sites More sharing options...
Sepu Posted September 19, 2017 Share Posted September 19, 2017 You can always use the pop proximity if you are having difficulties to understand the vex code. Right now target variable is just saying that is 1 unit up in Y if you want to you obj there, you can use the point function. The fit function is just taking whatever output you are getting from the dist variable and shift them to the new values between 0 and 1, in this case (0,1), if that makes sense. Looking at the spreadsheet will help you understand what is going. http://www.sidefx.com/docs/houdini/vex/functions/fit Quote Link to comment Share on other sites More sharing options...
logix1390 Posted September 19, 2017 Author Share Posted September 19, 2017 Hi Sepu, Thanks for the tips, I think i got it working now. Quote Link to comment Share on other sites More sharing options...
dudenay Posted September 19, 2017 Share Posted September 19, 2017 Hi Logix1390, The vex code you are using does something else than slowing down when the distance between your emitter and your particles is growing. Actually it's doing the opposite: it's slowing down when your particles are approaching the target. In the " // Drag by Proximity to Point" code you can define the target you want by replacing the target position. To understand easily what is going on, i always consider the process for a single particle. As you say you get it, did you do it in vex? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.