Halltom92 Posted December 21, 2017 Share Posted December 21, 2017 Hi, I'm currently trying to assemble a chain, driven by a guide curve. Using the copy to points node, I'm trying to figure out how to rotate every other copy by 90 degrees. I can only seem to control the orientation using N, which is set to the tangent of the guide curve. I'm sure I'm able to do this using the orient attribute, but I'm not completely sure how to. Any help would be gratefully received. Thanks odforce_test_001.hip Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 21, 2017 Share Posted December 21, 2017 (edited) One way to do it, will be using an @up vector and a cross product between the current up and N from the polyframe. Use the module function to rotate every other chain. v@up = {0,1,0}; if(@ptnum % 2 == 1){ @up = cross(@up, @N); } odforce_test_001_FIX.hip Edited December 21, 2017 by Sepu 1 Quote Link to comment Share on other sites More sharing options...
Halltom92 Posted December 22, 2017 Author Share Posted December 22, 2017 That's perfect. Thanks for your help. Merry Christmas Quote Link to comment Share on other sites More sharing options...
Parboil Posted January 2, 2018 Share Posted January 2, 2018 (edited) Recreated the chain rotation setup a slightly different way. Using 45 degree interval rotations and there is a global rotation offset. vector temp_up = set(0, 1, 0); @N = normalize(@N); @up = cross(temp_up, @N); v@binormal = cross(@N, @up); setattribtypeinfo(0, "point", "binormal", "point"); matrix3 mat = set(@N, @binormal, @up); float rot = radians(chf("rotate")); rot += 45 * @ptnum; rotate(mat, rot, @N); @orient = quaternion(mat); Edited January 2, 2018 by Parboil 1 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.