Jump to content

copy to points rotation


Halltom92

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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 by Parboil
  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...