KiLa Posted November 5, 2016 Share Posted November 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 5, 2016 Share Posted November 5, 2016 Just define the amount of rotation, translation and scaling as an attribute first. then use the amount to rotate forth and back. trans_rot_back.hipnc Quote Link to comment Share on other sites More sharing options...
KiLa Posted November 5, 2016 Author Share Posted November 5, 2016 Didn't quite understand you file Konstantin Is there a way to do it in Point VOP? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 5, 2016 Share Posted November 5, 2016 Probably, but I doubt it will be easier than this. Do you have a hip file of your problem or is it the one you provided? Quote Link to comment Share on other sites More sharing options...
KiLa Posted November 5, 2016 Author Share Posted November 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 5, 2016 Share Posted November 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
mosssi Posted November 5, 2016 Share Posted November 5, 2016 (edited) 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 November 5, 2016 by mosssi 1 Quote Link to comment Share on other sites More sharing options...
KiLa Posted November 5, 2016 Author Share Posted November 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
mosssi Posted November 5, 2016 Share Posted November 5, 2016 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. 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.