dtarr77 Posted February 11, 2016 Share Posted February 11, 2016 (edited) 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. 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 February 11, 2016 by dtarr77 Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted February 11, 2016 Share Posted February 11, 2016 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. Quote Link to comment Share on other sites More sharing options...
dtarr77 Posted February 11, 2016 Author Share Posted February 11, 2016 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. Quote Link to comment Share on other sites More sharing options...
Sean Posted February 12, 2016 Share Posted February 12, 2016 You could middle mouse click on one of the inputs of the subtract node and select promote parameter, then set it to vector. With this promoted you could use the centroid expression at the top level. Quote Link to comment Share on other sites More sharing options...
dtarr77 Posted February 12, 2016 Author Share Posted February 12, 2016 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 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. Quote Link to comment Share on other sites More sharing options...
dtarr77 Posted February 12, 2016 Author Share Posted February 12, 2016 (edited) 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 February 12, 2016 by dtarr77 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.