Jump to content

Reset rotation


KiLa

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

Link to comment
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

Link to comment
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
  • Like 1
Link to comment
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.

Link to comment
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.

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...