mirroring objects with MCG

mirroring objects with MCG

Anonymous
Not applicable
1,069 Views
9 Replies
Message 1 of 10

mirroring objects with MCG

Anonymous
Not applicable

So I've been trying to create a compound that mirrors an object along a specific axis. I've tried different approaches, but none of them *really* worked. The first one was to simply rotate the object, using an offset to get it back to the original position and combined both meshes into one. Which resulted in some slight offsets (no idea why) and a lot of nodes. The second one was to offset the mesh, then scale it by -100%. Which worked great, but (as it was to be expected) it flipped all the normals. So i've been searching for a solution to flip the normals of the mirrored object again, but didn't find anything.

 

Has anyone ever tried anything similar and has a solution for my problem? 

0 Likes
Accepted solutions (1)
1,070 Views
9 Replies
Replies (9)
Message 2 of 10

Swordslayer
Advisor
Advisor

To flip mesh normals, you have to recreate the mesh faces with reversed vertex order (by mirroring it, you reversed it from CCW to CW). So if a face is currently [1,2,3], you need to change it to [3,2,1]. In praxis, just flipping a mesh looks like this:

 

flipMesh.png

 

Note that you'd have to do the same for all mapping channels as well, if you wanted them to look the same as before.

 

 

Message 3 of 10

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous,

 

@Swordslayer is killing it in these MCG threads, kudos!  I wanted to follow up here and check to see if this solved your problem.  Thanks for any confirmation!

Best Regards,

0 Likes
Message 4 of 10

Anonymous
Not applicable

To be honest, I haven't had the time to try his out, because a more important project needs to be done in the meantime, but as soon as I can try this, I will report my experiences.

0 Likes
Message 5 of 10

Anonymous
Not applicable

Hmm... Interesting. I just tried out your graph, and (as expected) it worked just fine, but as you mentioned, it does so for only a single channel. Out of curiosity I tried to simply flip (via the Reverse node) all the MeshVertices and all the MeshIndices and voillá: no inverted Meshes anymore.

 

Maybe there is something wrong with this solution, but after some quick testing it seems to work just fine.

 

FlipMeshes.PNG

0 Likes
Message 6 of 10

Swordslayer
Advisor
Advisor

That would only work for 'reversible' topology, try it on a teapot to see what I mean. Plus even with the reversible topology, it flips the order of verts and face indices so any topology dependent modifiers will freak out as well.

0 Likes
Message 7 of 10

Anonymous
Not applicable

I see... well that's a bummer. My problem in this case is that i don't really know how many map channels my mesh has, because that depends on the mesh. 

0 Likes
Message 8 of 10

Swordslayer
Advisor
Advisor
Accepted solution
Message 9 of 10

Anonymous
Not applicable

Thanks a lot! This worked very well.

 

I wouldn't be able to figure that out by myself. 

 

BTW: As it seems, this doesn't work too well with the graph that deletes random objects from an array of meshes (the other thread i've started). If I flip the normals before that the result is pretty much the same as if I wouldn't use it. This is NOT a problem, but something someone might be interested in.

 

Just out of curiousity: Where did you get all this knowledge from? Because there isn't too much documentation for this, neither are many tutorials available.

0 Likes
Message 10 of 10

Swordslayer
Advisor
Advisor

@Anonymous wrote:

Thanks a lot! This worked very well.

 

I wouldn't be able to figure that out by myself. 

 

BTW: As it seems, this doesn't work too well with the graph that deletes random objects from an array of meshes (the other thread i've started). If I flip the normals before that the result is pretty much the same as if I wouldn't use it. This is NOT a problem, but something someone might be interested in.


What you are doing there is bad practice anyway, you should keep it only as transforms till the very last step. 

 


@Anonymous wrote:

Just out of curiousity: Where did you get all this knowledge from? Because there isn't too much documentation for this, neither are many tutorials available.


There are many sample graphs, I learned by dissecting some of those, opening compounds and seeing how they work. Whenever you're not sure how to use a node, open the Operator Description window, see the Used in compounds: list and open one or more of those compounds to see how it's used.