reyan Posted October 10, 2018 Share Posted October 10, 2018 Hello magicians, i'm trying to do a curve collision in VEX, using volume sample and volume gradient for calculating collisions. i would like to understand how implement the original curve restlength in my VEX code, as you can see of course the curve stretch until now. Any suggestion, link, idea ? Thanks in advance collision_test.hip Quote Link to comment Share on other sites More sharing options...
pxptpw Posted October 10, 2018 Share Posted October 10, 2018 Hi Reyan, if you search for volume sample in the forum you will find good explanations about these vex functions and how they operate , dont know if understood your question right , from what i understand , distance to the point = volume sample, and the gradient calculates the direction towards the point, to get the curve collision, your code could be reduced to this , float volume_sample = volumesample(1,0,@P); vector volume_gradient = volumegradient(1,0,@P); if(volume_sample <= 0) @P -= normalize(volume_gradient)*volume_sample; and the if you plug the ray sop , it does the same thing 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.