Justin K Posted April 16, 2018 Share Posted April 16, 2018 (edited) Hello all, I am sending some geometry pieces back to the origin to do some manipulation. Im using a for loop, and within the loop Ive at least managed to move each piece back to the center. The issue is rotation. I want the objects existing normals "N" to be flush with the x axis while working, and the objects 'up' vector to be flush with Y axis {0,1,0}. I know I can use the arccos(dot(up, up2) function to get the angle I need, (and have done so), my issue is I cant figure out how to rotate the pieces accordingly. So basically--object incorrectly rotated at center-- its existing Normals should face towards +x {1,0,0}, and its "up" vector should face towards {0,1,0}. After work is done, Id like to be able to send the piece back to where it came from, but am a bit stuck. Thanks for the help!!! rotation_reset_at_origin.hipnc Edited April 17, 2018 by JKeil Quote Link to comment Share on other sites More sharing options...
Justin K Posted April 17, 2018 Author Share Posted April 17, 2018 Hey, So I have made some progress. I found way to orient the object the way I desired within the loop for work purposes. Working on the setup for transferring the rotations back when the time comes now. now. Let me know if you have any suggestions all! rotation_update_01.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted April 17, 2018 Share Posted April 17, 2018 (edited) you don't need loop at all, just promote your attribs to get average values per prim to each point compute transform attribute and invert transform then use Transform By Attribute SOP to transform back and forth as you need, see the file rotation_reset_at_origin_fix.hipnc Edited April 17, 2018 by anim 3 Quote Link to comment Share on other sites More sharing options...
Justin K Posted April 17, 2018 Author Share Posted April 17, 2018 7 hours ago, anim said: you don't need loop at all, just promote your attribs to get average values per prim to each point compute transform attribute and invert transform then use Transform By Attribute SOP to transform back and forth as you need, see the file rotation_reset_at_origin_fix.hipnc Thanks Tomas!-- a much more straightforward method than I was conjuring up. Solved! 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.