I'm hoping someone can help me out with creating a gradient descent algorithm in VOPs (it might not be possible?).
I've be trying to reverse engineer this - https://vimeo.com/60606152 [vimeo.com] which is done with Rhino. I can get as far as the point where you need to push the points back to the surface (timecode 2:49 in the video). They do this using a surface CP node (which as far as I can tell imports the vectors for the nurbs surface?). Is the there an equivalent way of doing this in VOPs or am I going about it in the wrong way? Any help will be much appreciated.
Thank you,
Mark
Gradient Descent
3093 2 1- Mark Lindner
- Member
- 11 posts
- Joined: July 2013
- Offline
- tjeeds
- Member
- 339 posts
- Joined: Aug. 2007
- Offline
- negow
- Member
- 27 posts
- Joined: Jan. 2007
- Offline
I ported the example to VEX, thought it might be helpful even though the thread is a few years now.
int numiterations = chi("number_of_iterations"); float gravity = chf("gravity"); float max_search_distance = chf("max_search_distance"); vector last_position = @P; for (int _i=0; _i < numiterations; _i++) { // Move with gravity // | // | // v vector new_position = last_position + set(0, -gravity, 0); // Resolve collision // // _____| // / | // / |\ // / v --> // \____ // last_position = minpos(1, "", new_position, max_search_distance); int ptnum = addpoint(0, last_position); setpointattrib(0, "id", ptnum, @ptnum); }
-
- Quick Links