Jump to content

Custom Velocity Decay Question


dtarr77

Recommended Posts

Hello,

 

I have been learning how to create custom velocity fields and trying to figure out how to get my velocity to decay the further from the center it is.  For example, my scene has a sphere who's normals are directing velocity along with a noise field. 

 

post-15049-0-09079700-1455228105_thumb.p

 

I want to have the velocity lessen as it gets further from the center of the sphere.  I figured creating a ramp  in a VOPSOP whose value could control that might do the trick, but I am still pretty new to VEX and VOPs and such.  How would I get a ramp color to do this?  If that is not a good route, what is the best way to achieve this velocity decay and control it manually like this?  Thank you in advance for any help or advice.

Edited by dtarr77
Link to comment
Share on other sites

subtracting 2 vectors you get a third vector pointing from the second to the first. If you take the length of that you get the distance. now that you have the distance, you can fit it (ex. from 0-10 to 1-0) and multiply it against your velocity. In this example you can use the centroid of your sphere and each point's position. The fit can be passed into a spline ramp now that it is in 0-1 range.

Link to comment
Share on other sites

Hey dchow,

 

Thank you so much for replying.  I am pretty sure I understand the process you describe, but doing it is another story.  I see a "center" output in VolumeVops (is that where this process should take place?) and tried your process according to your description but I don't think I did it right since it doesn't seem to be working.  I looked at Attribute/Point VOPs and I did not see a center/centroid output.  How do you grab that vector value?  I have attached a screencap of my node graph inside VolumeVOPs.

 

post-15049-0-32409000-1455233904_thumb.p

 

 

Link to comment
Share on other sites

Thanks for replying Sean.  That makes sense, I had seen that centroid expression in my searches, but had not known how to implement it here.  I still have a lot to learn. haha :blush:    Unfortunately, the vop still doesn't seem to be decreasing the velocity so there must be another issue as well, but that's one part of the issue solved.  I will keep messing with it though.  Thank you Sean.

Link to comment
Share on other sites

Actually, I think I figured out the issue.  Just needed to play with the Fit Range node a little more.  I was adjusting the wrong Fit Range Max values.  I was increasing the Destination Max instead of the Source Max.  I also had to reverse the spline ramp because it was decreasing in the center and increasing towards the outside.  Seems like it is working now though.  Thank you very much to both of you.  I really appreciate the help.

Edited by dtarr77
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...