title: Ear cliping - right perspective
body: <p>I am using OpenGL. Right now I am programming 3D model loader by using ear cliping algorithm.
  My main problem is which axis should I use. I have 3 options: (X Y) , (Z Y) , (X Z).
  For instance, If I Have a quad - 4 points - (1, 1, 0) (-1, 1, 0) (-1, -1, 0) (1, -1, 0) I need the (X Y) axis because All the Z are the same.</p>
  
  <p>So I have been trying to program some code which can know what 2 axis I need. It checks if one of the axis is the same to the others. </p>
  
  <p>But this code works only when one axis is the same. When the polygon on slant the code does not work. So I have been added to the code a function check which checking if all the vertices on same line, Then I got this polygon and my code failed:</p>
  
  <p><img src="https://i.imgur.com/TiD75df.png" alt="..."></p>
  
  <p>You can see that at the top this is vertex, At the right one vertex and at the bottom there are 3 vertices. As you can see (X Z) is the right axis which I should fine.
  If you look on the (Z Y) axis you can see this:</p>
  
  <p><img src="https://i.imgur.com/9ONhS25.png" alt="..."></p>
  
  <p>one vertex on the left, one at the middle and 3 vertices on the right. Not all the vertices are on the same line and I can not check which axis should I use. Because if I will use the (Z Y) axis the ear cliping algorithm will not work.</p>
  
  <p>How can I know which 2 axis should I use? I am using C++.</p>