Jump to content
KiLa

Reset rotation

Recommended Posts

Hi, is there a way to reset object's rotation/translation procedurally in Point VOP?

I think that i have found an answer for the translation part: subtract object's centroid from the point pos. But the rotation...argh - too much math that i don't understand :(

Cheers

-kimmo

copy.hipnc

Share this post


Link to post
Share on other sites

Didn't quite understand you file Konstantin :( Is there a way to do it in Point VOP?

Share this post


Link to post
Share on other sites

The one i provided demonstrates what i'm trying to do - create a node which will reset objects rotation and translation in to origin so that it can be used in Copy SOP.

Share this post


Link to post
Share on other sites

well, how is the pointVOP supposed to know where your prim used to be and how it was aligned?

yes, you can put it back to the center of the world assuming it has been there before, but thats just guess work. i just fed the original point positions in there, but i am not sure if thats what you need.

copy2.hipnc

Share this post


Link to post
Share on other sites

There is way which is a little bit complex and I don't know if it's necessary for you to do this. But you can try this:

- create up and front vectors based on the desired shape

- create a matrix 3 with side, up and front vectors (side vector is cross product of the other two.)

- convert matrix 3 to 4

- "translate" the matrix with centroid vector

- "invert" the new matrix 4

- "multiply" with P

and you can "multiply" the un-inverted matrix again with new P to restore the position and rotation.

 

If it's not clear enough maybe I can create a hip on tomorrow.

Edited by mosssi

Share this post


Link to post
Share on other sites

Thx K and moss, maybe i am asking/hoping too musch. It would be nice if there was a way to move object to origin and reset its rotation, since in order to get expected results from Copy SOP, source geo must be in the center, without any rotation.

Share this post


Link to post
Share on other sites
5 minutes ago, KiLa said:

Thx K and moss, maybe i am asking/hoping too musch. It would be nice if there was a way to move object to origin and reset its rotation, since in order to get expected results from Copy SOP, source geo must be in the center, without any rotation.

Let me describe the problem a bit more. when You have a transformed object like your sample grid on your scene you have two options:

1- you have your original grid with no rotation (we are thinking about a more complex object), so you can use some simple formula to turn back your grid to the default rotation like -30 on "rx" channel.

2- you don't have the original geo so you have two choice:

     - Do it based on your viewport with move and rotate tools and layout your geo to the center and rotate it backward. (for static objects)

     - Do what I described before (which is for animated objects)

 

I hope that helps.

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

×