Ruki, could you give a pseudocode version of the algorithm here, for a polygon defined by a line strip. You know, x1 y1 x 2 y2 etc.
I am sorry, I can hardly describe clearly by the pseudo-code algorithm.
You can refer to the comments in the source code if want to know more about this algorithm. :)