In my program I need to select 4 vertices from two triangles.
Unfortunally, sometime the selection look like:
4 ----- 3
| |
| |
1 ----- 2
The good case but sometime:
3 ----- 2
\ /
/ \
1 ----- 4
the bad case ...
Is there any good and robust solution to make sure that I process my vertices in the right order?
Cheers !
Convex polygon ...
Started by Groove, Nov 06 2006 05:57 PM
1 reply to this topic
#1
Posted 06 November 2006 - 05:57 PM
#2
Posted 06 November 2006 - 06:38 PM
You can do a crossproduct between any two adjacent edges and check whether the results always point in the same direction.
Or you can project the points on a plane and calculate the convex hull around the points, that would give you the right answer immediately.
Or you can project the points on a plane and calculate the convex hull around the points, that would give you the right answer immediately.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












