Complex UV Layout in Maya
Over the last couple of years UV layout in Maya has changed for the better. In this course we're going to be taking a look at some of those changes as we UV map an entire character
# 1 02-05-2013 , 02:40 PM
Registered User
Join Date: Apr 2013
Location: Atlanta, GA
Posts: 15

aligning 2 high-poly meshes

I'm struggling to precisely align two unwieldy high-poly meshes that share an overlapped region. My approach is to pick three common points of interest in the overlap, create null objects at the three locations on the respective meshes, then snap align the two sets of null objects only using translation, allowing the rotation to follow the triangulation between the three common points. My understanding is that I use pointConstraints, and assign attributes in the Node editor to translation, but I'm a total newb, can't find any tutorial or Help instructions guiding me through the steps of bringing up my meshes, nulls, etc. in the node editor and how to connect outputs to inputs. Well, I am finding pages, but I get lost around simple fundamentals in the language, would greatly appreciate a helpful hand. Thanks in advance.

# 2 02-05-2013 , 02:52 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Not sure what you want, could you show the meshes and what sort of constraint you are looking for............dave




Avatar Challenge Winner 2010
# 3 02-05-2013 , 03:48 PM
Registered User
Join Date: Apr 2013
Location: Atlanta, GA
Posts: 15
Hi Dave, thanks. I'm new here, don't even see a way to attach frame grabs, but if I can offer a clearer description of the scene. One mesh, about 8-million polys, is of the floor of a section of cave. It overlaps with a second mesh, the left wall of that passage. It would take forever to precisely align these two behemoths translating and rotating from their respective points of origin. So, the approach is to identify 3 features common to both meshes and align those by position, allowing rotation to follow. Clear so far? I've created null objects at the three locations common to both meshes, so 6 total. I'm thinking I need to constrain one null of one mesh to that particular vertice it's closest to, using only translation. I'm thinking I need to do this for each of the remaining 5 nulls. And then, I would think I could simply snap align one null on mesh 1 to its corresponding null on mesh 2 to bring the first common point into registration, step and repeat for common points 2 and 3. This is generally how data sets from LiDAR scans are connected using various spheres physically set in a scene common to two survey stations, though I'm not using LiDAR, but the joining of two overlapping meshes is the same, so it follows that the approach would be similar. Thanks for your help! Benjy

# 4 02-05-2013 , 04:00 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Try moving the pivot point (with mesh selected press the "insert" key) to one corner of each mesh with witch they share then snap to a close vert and thenjust a case of rotate or scale..................dave

Edit: Your poly count does sound high try creating a normal map to a lower poly model




Avatar Challenge Winner 2010

Last edited by daverave; 02-05-2013 at 04:02 PM.
# 5 02-05-2013 , 04:04 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
That's a really interesting problem. Aligning the first pair of locators is easy, you can parent the mesh to the locator, and snap move the one locator to the other (hold v). But the other ones are more tricky. I don't think you'll be able to use point constraints, because you'd have to have multiple locators constraining the translation of the mesh, which I don't think is allowed. Can you not line up one pair of locators and free rotate the mesh into alignment?

# 6 02-05-2013 , 04:26 PM
Registered User
Join Date: Apr 2013
Location: Atlanta, GA
Posts: 15
Gosh, I'm kind of surprised to hear you scratching your head (glad we're on the same page at least understanding the problem), it seems like such a simple need, one encountered many times over before. I'd like to try at least connecting one null object to mesh 1, the corresponding null to mesh 2, and snap aligning the two nulls. I can then attempt, according to your suggestion, rotating one mesh from that locator against the second mesh and see how far I get, use two panels, one to grab onto the rotation, the other ever more close up on the far end of the mesh to see how close I'm getting. It would appear quite cumbersome to incrementally rotate on all three axis little by little to hone in on final registration. Seeming I have many meshes to align, there must be an elegant solution. For now, I'm thankful if you can advise me how I attach my null object to lock to a mesh at its location. Do I select the closest vertice on the mesh and do something with it that allows me to constrain the null to that point? Thanks, again.

# 7 02-05-2013 , 04:38 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I'd actually parent the mesh to the locator. Snap the locator to a vertex of interest: select locator, select the move tool, hold v and MMB drag a little bit on the vertex, it should snap as long the move tool is free to move in all three axes(click the yellow box in the middle if not). Then select the mesh, shift select the locator and hit p. Do that for both meshes. Then select the first locator and do the vertex snap on the other locator. Both locators should now be in the same spot. You could do it with constraints, but this is the simplest I think.

# 8 02-05-2013 , 04:39 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Your over complicating stuff...............dave

Attached Thumbnails



Avatar Challenge Winner 2010
# 9 02-05-2013 , 04:42 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Dave, I think the point is that with >8 million polys, the vertex won't necessarily be at the corner. So the locators help to find the proper corresponding vertices. The snapping is the same, but the real problem is that scaling and rotating is now arbitrary, instead of an automated snap.

# 10 02-05-2013 , 07:09 PM
Registered User
Join Date: Apr 2013
Location: Atlanta, GA
Posts: 15
I feel like a helpless toddler, between unconscious incompetence to conscious...

I've tried snapping together the two null objects, odd results. But first, I had the idea to scale my null objects large enough to see them better when viewing the full mesh, this in anticipation of rotating one mesh (via its parent null) against the other. I also shaded one set of three null objects a different color from the other, making registration yet easier. Acquiring such simple skills ate a little time. Then I go to play with the snap alignment tool, and encounter totally unexpected behavior. Again, three null objects (spheres) precisely located at common points of interest on mesh 1, the mesh and the latter two null objects each parented to the first null — I move null 1, the other two nulls and mesh 1 follow. I do the same for mesh 2 and its corresponding 3 nulls. In the Hypergraph panel I select null 1, shift select null 2, I go to Modify, Snap Align Objects, Align Objects, see movement, but parent null 1 and parent null 4 aren't in the same location. If I move parent null 1 closer to null 4 before the snap align, I get different results, so it appears there's some kind of averaging of locations between the parent and all leaf objects that's operating on the alignment. Any ideas? Thanks again, it's kind of embarrassing being a toddler drooling uncontrollably;^(


Last edited by BenjyvC; 02-05-2013 at 07:11 PM.
# 11 02-05-2013 , 07:56 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I've attached a couple images explaining my original idea, hope it helps. I'm really not sure how to get the second and third locators snapped together, maybe my images will give other people ideas.

Attached Thumbnails
# 12 02-05-2013 , 09:25 PM
Registered User
Join Date: Apr 2013
Location: Atlanta, GA
Posts: 15
Nice, that works on my end, thanks. To speed setting my null objects (it's taking a long time to resize and reposition the spheres as I move in on the point of interest down to the vertice leve), can I use this same pointConstraint to first select the null object, then shift select a vertice, then add the constraint to zip the location of the null to the vertice? I'll just try that. Thanks, and if others have a clue how to get nulls 2 and 3 to jump in, that would be awesome. Some truly generous souls out there helping us newbs, big thanks. Benjy

# 13 02-05-2013 , 09:31 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I'm not sure that point constraints work at the component level. You can try it though.

# 14 03-05-2013 , 01:52 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988


Imagination is more important than knowledge.
# 15 03-05-2013 , 02:52 AM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
What has me confused about what you are trying to do is why the strict restriction to translation when this is a far easier problem to solve through a combination of translation and rotation.

Lets have two surfaces A and B and they start out intersecting each other and are in the orientation we want. If you select three points (a1,a2,a3) on surface A that are coincident with three points (b1,b2,b3) on surface B.

Then you randomly rotate and translate the two surfaces.

You could realign them in three steps (for this process I am assuming that we are only interested in realigning surface A to surface B and not the two surfaces to the world coordinates.)

(Step 1 - TRANSLATION) There must exist a translation A(tx,ty,tz) such that a1 and b1 are coincident. In other words move surface A until its a1 end point is point constrained to surface B's b1 end point.

(Step 2 - ROTATION) With points a1,b1 point constrained there must exist a rotation of surface A about point a1 => A(rx,ry,rz) will bring the middle point of surface A (a2) together with b2 of surface B. In other words rotate surface A about point a1 such that a2 and b2 are coincident.

(Step 3 - ROTATION) now with a1 point constrained to b1 through translation and a2 point constrained to b2 through rotation of surface A about point a1 it should be obvious that we now only need rotate surface A about an axis running through the straight line between points a1,b1 and a2,b2. So we have a vector V<a1b1,a2b2> and there must exist a rotation about that vector V(rv) that will bring the points a3 and b3 together.


How you accomplish it in Maya I don't really know but to me the most intuitive solution involves 1 translation, 1 multi-axis rotation about a point, 1 single-axis rotation about a Vector between the first two point to realign the surfaces.


"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675

Last edited by ctbram; 03-05-2013 at 04:46 PM.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads