raven0us Posted July 25, 2009 Share Posted July 25, 2009 (edited) Hi, I'm trying to copy a group of curves(group 1) to another group of curves(group 2) . Each group has the same number of curves. Curve in group 1 gets copied to the corresponding curve in group 2's "root"-point 0. I've attached a file where I've used forEach sop. Using the point() I can get it to work partially...works for the first curve but the rest of the curves also move by that same distance instead of being moved by their own distances.So the curves other than the first don't get copied properly.For each class/primitive it's just calculating the point 0...How can I get it to iterate.. I'm modeling the curves (hair style). I then "transplant"/copy them to the guides.That way I can be very specific about my character's hair style without having to use comb sop. curves.hip Edited July 26, 2009 by raven0us Quote Link to comment Share on other sites More sharing options...
anim Posted July 26, 2009 Share Posted July 26, 2009 something like this? just slightly changed your file: bringing group 2 into foreach too then use delete sop to keep only current(corresponding) curve then translate by difference in point0 positions curves_fix.hip Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 26, 2009 Author Share Posted July 26, 2009 (edited) Thanks a lot Tomas...Works nicely. Not really relevant to this post... attached character I'm working on. Maybe I'll post it later in the WIP or final forum when it's done. Modeling and Animation done in "M"+("*"*3) hair & dynamics -> Houdini transitioning to Houdini ...Great app...great forum too hair.wmv Edited July 26, 2009 by raven0us Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 26, 2009 Author Share Posted July 26, 2009 This works as well.... ...another each sop that's the same as the other each sop...replacing the delete... curves_fix02.hip Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 28, 2009 Author Share Posted July 28, 2009 Hi, the new set of curves are sticking to the geometry... But how can I get it to orient? Curves_rot.hipnc Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 28, 2009 Author Share Posted July 28, 2009 (edited) Hi, apologies.......hit the panic button too soon. Curves_rotfix.hipnc Edited July 28, 2009 by raven0us Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 28, 2009 Share Posted July 28, 2009 (edited) Hi, apologies.......hit the panic button too soon. Curves_rotfix.hipnc Yeah, but they are not oriented like those straight ones. Below is better aproach. look into forEach node. Curves_rot.hipnc Edited July 28, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 28, 2009 Author Share Posted July 28, 2009 wow Swann, very nice. thanks a lot. ....more stuff to dig into..... Quote Link to comment Share on other sites More sharing options...
anim Posted July 28, 2009 Share Posted July 28, 2009 you better add some up-vector too because your rotation will never be correct if you are just aligning one axis Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 28, 2009 Author Share Posted July 28, 2009 Tomas, I was getting some crazy flipping...remembered about an old thread here about copying some geometry without flipping...searched docs for "up vector" and what do you know....added the attribute and it all works now.... thanks a lot for the info. Swann, simply copying inside the forEach at the moment, But your setup is neato.Don't understand it fully. great for learning..perhaps for some cooler things in the future.thanks. pigTailsNoFlip.wmv Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 28, 2009 Share Posted July 28, 2009 (edited) Swann, simply copying inside the forEach at the moment, But your setup is neato.Don't understand it fully. great for learning..perhaps for some cooler things in the future.thanks. If I understand matrices correctly you could do this orientation using only one VopSOP. Just instead creating 3x3 matrix and then translating you should use 4x4 matrix that can contain translation. But I don't know how to do this, just readed about it and haven't got time yet to go learn it practicaly. Edited July 28, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
edward Posted July 29, 2009 Share Posted July 29, 2009 I haven't read this thread too closely. Are you guys trying to do what my .hip file did on this thread? Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 29, 2009 Share Posted July 29, 2009 I haven't read this thread too closely. Are you guys trying to do what my .hip file did on this thread? Hey edward, So how to construct 4x4 matrix that rotate and translate ? As I understand I need 4D Vector(Quaternion) that will feed last row of my 4x4 matrix somehow, or maybe I misunderstood something in my book ? Quote Link to comment Share on other sites More sharing options...
edward Posted July 29, 2009 Share Posted July 29, 2009 What do you mean? Construct a 4x4 matrix where? That .hip file I posted there creates a quaternion attribute that the copy sop directly uses. A quaternion is ROTATION only. Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 30, 2009 Share Posted July 30, 2009 (edited) In example couple posts up here I added first rotation with 3x3 matrix and then in the next VOP translated line to place it where template line was. In this book they say that 4x4 matrix can be used not only for rotation but also translation. Here on 24 page, 7 point, they construct such a matrix. Before they made 4x4 translation translation matrix they nedeed 4D Vector to construct it, hence I'm talked about Quaternion. Later it just simple mulipying of rotation matrix and translation matrix to get only one 4x4 matrix that contains all transformations. I tryed to do this but I failed. Since you came with 4D vectors(quaternions) and they are needed for this task also, so I thought you are the right person to ask about it. Thats all story. Edited July 30, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
raven0us Posted July 30, 2009 Author Share Posted July 30, 2009 Thanks Edward... didn't try the "orient" attribute...for now "up" seems to be working/holding up..wonder what will happen if the character does a flip....For now she doesn't have to. ... Quote Link to comment Share on other sites More sharing options...
edward Posted July 30, 2009 Share Posted July 30, 2009 Later it just simple mulipying of rotation matrix and translation matrix to get only one 4x4 matrix that contains all transformations. I tryed to do this but I failed. To convert a 3x3 matrix, you just pad the extra row and column with 0s and put a 1 at the corner. In VOPs, use a Quaternion to Matrix3 VOP, followed by a Matrix3 to Matrix4 VOP. Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 30, 2009 Share Posted July 30, 2009 (edited) Eureka! I'v made IT. Thanks Edward. Especialy for part about padding zeros and one. Started to mess with print VOP and this is effect. raven0us, how about that example ? So small change but gives so much happiness and clearer view in dense networks 4x4_Matrix_Rotate_And_Translate.hipnc Edited July 30, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 30, 2009 Share Posted July 30, 2009 Actually you can do this even simpler 4x4_Matrix_Rotate_And_Translate_Simpler.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted July 30, 2009 Share Posted July 30, 2009 why the hocus-pocus with matrix conversion? why not just multiply by rot matrix and add P difference? I do not think that aligning the hair with vector first-end point is desired effect, better would be first-second or only pure axis alignment. But this is just a thought since i do not know the desired usage 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.