Jump to content
JKeil

Resetting Object Rotations at Origin Based on Attributes (SOLVED)

Recommended Posts

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 by JKeil

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by anim
  • Like 2

Share this post


Link to post
Share on other sites
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!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×