Gecoblack Posted April 30, 2018 Share Posted April 30, 2018 Hi, I have a problem I'm struggling with vex code; I have a line with 3 points for example and I created an array attribute called "parentPt" that tells for every point of the line which are the related points. After that, I want to rotate those points in the array around the current pt that has the attribute. For example, I have a line with 3 points; point 0 has [1,2] as parentPt attrib, point1 has [2], point 2 has an empty array []. I want to rotate pt1 and pt2 around pt0 then rotate pt2 again but around 1 and so on. It is a little bit difficult to explain, so I attached an hip file. Any help would be really appreciated. Thanks! Odf_Example.hipnc Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted May 1, 2018 Share Posted May 1, 2018 So basicly you want to bend the curve? When you try to do it on a per point basis the surrounding points will work on "old" positions and they will not get the updated position. You need to rotate all your points from the first point, then the first point is free, and then you start with all the points from the second one and so on. And all the affected points needs to know where the new location of the "parent" is. Its easiest to do this per primitive, since one curve is a prim. Heres an example of how i would do it. Odf_Example_fix.hipnc 3 Quote Link to comment Share on other sites More sharing options...
Gecoblack Posted May 1, 2018 Author Share Posted May 1, 2018 That is great. I still have to learn a lot about vex. Thank you so much! 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.