Vertex winding order

I understand what the winding order is, and how it is used to discard the back surface.

However, I'm not quite sure how 3D modeling programs like Blender can take an arbitrary group of triangles and direct them correctly.

I tried to find the answer, and this was the best I found:

http://www.gamedev.net/topic/550481-vertex-winding-order-counter-clockwise-oder-vertex---algorithm/

In principle, for each triangle you find its center (barycenter accurate), calculate the normal vector from this triangle that gives you a ray. You take this ray and check it against the intersection with any other triangle. If this is an even number, then your winding is correct, if it is an odd number, your winding is incorrect (I suppose it depends on how you created the normal vector, but somehow you use the odd / even strategy). In any case, this means that the whole process is usually O (n ^ 2). If you have 1000 triangles, then for each triangle you should check for intersection for 999 other triangles. Is there a less obvious way to branch vertices correctly, which is more efficient?

+3
source share
1

, .

test it against intersection against every other triangle.

, () , . - , ;)

, , , , O (n).

EDIT: , , , . , , , Google Sketchup , . , ( ), .

EDIT2: , - 50k + - ( ), , , , .

+3

All Articles