Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 18-01-2010 , 09:33 PM
Registered User
Join Date: Jan 2010
Posts: 2

Triangulation direction

Hello fellow Maya enthusiast,

I've got a bit of a problem with a polygonal terrain mesh I'm creating, namely when triangulated it tends to look rather distorted on the parts where it's stretched. This has everything to do with the triangulation direction of my faces, as they're exactly in the wrong direction. I have found the "Flip Triangle Edge" function in maya, which is exactly the function I need, only it's incredibly slow. By slow, I mean it's not very usable because I have to manually select every individual triangulate-edge and then apply the function. Imagine a terrain which has 100000 triangles, and I think you can see my problem :headbang:

Here's a model that helps illustrate the problem:
user added image

Now, these screens do not show the artefacts that the problem causes with my actual terrain, but it does illustrate the problem well.

So, my question. Is there any way to mass-flip the triangulate direction of a group of faces?

It should be possible with the formerly mentioned "Flip Triangle Edge" function, only selecting every triangulated edge is a nightmare. Perhaps there is a way to select all the triangulate edges after doing a triangulation function on a mesh? Or perhaps some other way to filter out these triangulate-edges? I have not found it, and am really in need for a solution.

user added image

Thank you for your time, and I really hope to find some kind of solution or work-around for this silly little problem.

Cheers and have a nice day,
Lennart

# 2 18-01-2010 , 11:16 PM
honestdom's Avatar
The Nurb Herd
Join Date: Oct 2007
Location: London
Posts: 2,381
do you have a screenshot of the pre-triangulated model? that might shed some light on the why process has done this.

...btw, if you select one edge and press the up arrow on your keyboard it will select the edge loop/ring. alternatively you can double click the edge and it will do the same.

# 3 19-01-2010 , 02:08 AM
Joopson's Avatar
Registered User
Join Date: Jul 2005
Location: Boston, MA
Posts: 2,314
I like you, Lennart, you seem cool. Hope you stick around.

At any rate, I don't know.

Try what Hammer said, because beside that I don't know. I always slave away manually when that happens, and it sucks.

Good luck on your model!


Environment Artist @ Plastic Piranha
www.joopson.com

Last edited by Joopson; 19-01-2010 at 02:10 AM.
# 4 19-01-2010 , 05:05 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
It isn't technically "wrong". What it's doing, is trying to preserve the planarity of the faces; this may or may not be what your looking for.

One cheap way to do it, is to create a plane with as many divisions as you want, triangulate it, then sculpt it. It should then have all the edges facing the same way.

Just a quick question however. Why does the direction matter, and why do you need to triangulate the mesh? It's generally not done expect when working with old game engines.

By the way, excellent post. You've really covered your question well.


Imagination is more important than knowledge.
# 5 19-01-2010 , 11:58 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
I think it should be possible to apply the function for each of the selected edges with a relatively simple script... not sure exactly how to build it though... Found this after a quick search:

Code:
for ( $node in $select )     // process each selection {
 /* … */
}
I can't test it because I currently don't have Maya installed but you can get the command for 'Flip Triangle Edge' from the script editor after using the operation. just replace it with the '/* … */' and run the script with the edges selected.

As for the selection of the edges - hammer has mentioned select edge loop/ring tool which should help you both spot and fix the problematic sections.

Hope this helped,
Benny


When in doubt, delete history and freeze transformations.

My latest snake game
(Requires DirectX9 SDK and Framework)
# 6 19-01-2010 , 02:05 PM
Registered User
Join Date: Jan 2010
Posts: 2

Possible solution

Hi People,

Thank you all for your responses.

With your help, I have found a solution, which makes me rather happy! Apparently, in the attribute editor of a mesh, you can set the triangulation direction of the quads to left, right or best shape. Using this feature, I just divvy up the mesh into separate parts, set up their triangulation directions, and whoopee -> triangulate. This simply allows me to triangulate entire sections of my terrain into the direction I choose, which gets rid of the nasty artefacts I've been having.

Wondering what artefacts? Here's an example!
user added image

I am now one happy artist, so I thank you all for your endeavours.

I'm one step closer to finishing this skiing terrain.
user added image

Cheers,
Lennart

# 7 19-01-2010 , 10:31 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Very cool mate. Glad you figured it out.

BennyK: What that does, is select each edge separately from all of the selected edges. This wouldn't be very useful, as it would flip all the triangles, regardless of their orientation.


Imagination is more important than knowledge.
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