evgen Posted October 16, 2011 Share Posted October 16, 2011 (edited) Hello. I have the little task. i need to bend curve by vector. It must be like tree branch on the wind. task is simple - we need to rotate every point around previous point since angle between current point position equals bend vector's direction. 1. Get point's pivot (its previous point's position) 2. Get cross-product between point position and bend vector direction 3. Rotate point since angle between point's position and bend vector becomes equals 0 I spend a few weeks with matrices, hou module and other ways to do this and decided to write here about this. I attach images of this effect Could you suggest correct algoritm of this task and necessary technics? Thanks Edited October 16, 2011 by evgen Quote Link to comment Share on other sites More sharing options...
eetu Posted October 17, 2011 Share Posted October 17, 2011 Hello. I have the little task. i need to bend curve by vector. It must be like tree branch on the wind. task is simple - we need to rotate every point around previous point since angle between current point position equals bend vector's direction. 1. Get point's pivot (its previous point's position) 2. Get cross-product between point position and bend vector direction 3. Rotate point since angle between point's position and bend vector becomes equals 0 I spend a few weeks with matrices, hou module and other ways to do this and decided to write here about this. I attach images of this effect Could you suggest correct algoritm of this task and necessary technics? Maybe your troubles come from the iterative nature of your algorithm. Seems to me, you would need to transform all points to make the first bend, then transform all points to make the second bend etc. If you're trying to do it all with one transformation, the algorithm as it stands would not work. You also need to make sure your point order is correct, and, when trying to do it with VOPs, you can't even be sure that the points are processed in order (they are not). I think you either need to do it with a ForEach SOP, which might be slow, or in VOPs and essentially calculate the the result for all points (at least up to current point) for each current point. This means you're doing a lot of redundant calculations, but might be faster in the end even so Might be I'm overlooking something obvious, though Quote Link to comment Share on other sites More sharing options...
eetu Posted October 17, 2011 Share Posted October 17, 2011 Could you suggest correct algoritm of this task and necessary technics? Ohh, I just had to try it - this is with a TransformAxis SOP inside a ForEach SOP. The vector manipulation can get a bit out of hand when using expressions, so doing this in a VOPSOP inside the ForEach would be nicer. ee_bend_v002.hip 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.