hyperforce Posted October 9, 2013 Share Posted October 9, 2013 I'm trying to blend together several curves. These curves have been deformed from a base curve, I wish to have these curves blend together in Y based on their weight attributes. Think of the snap to average point position function of the fuse node, but then with weight taken into account. In its simplest form I have 2 or more points, that need to be replaced by a point in their weighted average position. To clarify. here is an example: Point 1 is at Y = -10 with 90% influence Point 2 is at Y = 15 with 50% influence Point 3 is at Y = 5 with 20% influence Does anyone here know if there is a node that does this, or otherwise, what mathematical formula I need to use to solve this problem. Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 9, 2013 Share Posted October 9, 2013 Can't you put the data into chops and blend them over there? Quote Link to comment Share on other sites More sharing options...
acey195 Posted October 9, 2013 Share Posted October 9, 2013 Hey Erwin, I don't really know in which context you wanted to have this, but in SOPs it can easily be done in a vopsop. Let me know if the example in the attached file was what you were looking for . Twan WeightedCurves.hipnc Quote Link to comment Share on other sites More sharing options...
hyperforce Posted October 10, 2013 Author Share Posted October 10, 2013 Thanks Kim and Twan. I need it to be able to blend between a variable range of curves so a simple hardwire won't work. I did find a mathmetical formula to do it with. Take the weighted offset of each curve/point. Add these weighted offsets together. Also add the weights together. Divide the sum of the weighted offset by the sum of the weight. And the value you get back is the weighted average. I haven't worked much with chops so far, I need to have another look at those. Quote Link to comment Share on other sites More sharing options...
acey195 Posted October 10, 2013 Share Posted October 10, 2013 np, I did find a mathmetical formula to do it with. Take the weighted offset of each curve/point. Add these weighted offsets together. Also add the weights together. Divide the sum of the weighted offset by the sum of the weight. And the value you get back is the weighted average. That is basically exactly what the vopsop does , if you want a variable amount of curves, you will need to put it in a forloop and keep storing the positions and weights per curve to attributes with procedural names. Then calculate the result with a vopsop with a forloop inside it to go over all the stored data. That would be the most stable solution I guess, though possibly a bit over-designed. If you know the maximum number of curves is going to something like 5, you could also duplicate the vopsop 5 times for the 5 possibilities and simply feed them into a switch. 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.