Jump to content

Align 2 polygons


Recommended Posts

Hey guys!

Does anyone knows how could I align 2 polygons and then somehow access those angle values so I could reference it on another transform node. because using just align node, I can`t any attributes form it.

I added some screen shots so you get what I`m doing.

Basically I have 2 characters. One in rest position and other one animated. The animated one changes through out the shots. So i deleted out 1 polygon from each of them and by comparing them I could transform rest position to match first frame of animation. with position it`s no problem I just use centroid expression, but I`m stuck with rotation. I thought this one approach worked with attribute wrangle:

vector n1 = prim_normal(0, 0, 0.5, 0.5);
vector n2 = prim_normal(1, 0, 0.5, 0.5);

matrix3 rot_matrix = dihedral(n1, n2);

@P *= rot_matrix;

vector rotate = cracktransform(0,0,1,@P,rot_matrix);

v@out = rotate;

Where I compare normals,

But I discovered that if angle difference is quite big it does not work.

Basically I would like to do what align node does, but through vex or vops, so I could get some usable attributes out.

Thank you :)

 

 

snapshot9.png

snapshot10.png

snapshot11.png

snapshot12.png

Link to comment
Share on other sites

extract_transform.gif

It may be not what you are looking for, but try Extract Transform OBJ first. It extracts transform from geometry differences, not by simply subtracting object-level transforms, as I thought earlier. Quite powerful tool, may be used to align geometry at sop level also.

extract_transform.hipnc

 

It should help. Otherwise, another link may be useful:

 

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