Jump to content

copy a group of curves to another using forEach


Recommended Posts

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 by raven0us
Link to comment
Share on other sites

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) :blink:

hair & dynamics -> Houdini

transitioning to Houdini ...Great app...great forum too :)

hair.wmv

Edited by raven0us
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest Swann

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 by SWANN
Link to comment
Share on other sites

Guest Swann

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 ?

Link to comment
Share on other sites

Guest Swann

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 by SWANN
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest Swann

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 by SWANN
Link to comment
Share on other sites

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

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