I've got the good compare idea from this link.
Sorting a List of 3d coplanar points to be clockwise or counterclockwise
However, I tried to implement it, but seems not working.
Did I miss anything?
private int sortCounterClockWise(Vector3 center, Vector3 normal, Vector3 pointA, Vector3 pointB)
{
return (int)(Vector3.Dot(normal, Vector3.Cross(pointA - center, pointB - center)));
}
points.Sort((a, b) => sortCounterClockWise(center, normal, a, b));