public RasterTriangle(VertexPositionColor2D point1, VertexPositionColor2D point2, VertexPositionColor2D point3)
 {
     points    = new VertexPositionColor2D[3];
     points[0] = point1;
     points[1] = point2;
     points[2] = point3;
     sorted    = false;
 }
 public RasterTriangle(VertexPositionColor2D point1, VertexPositionColor2D point2, VertexPositionColor2D point3)
 {
     points = new VertexPositionColor2D[3];
     points[0] = point1;
     points[1] = point2;
     points[2] = point3;
     sorted = false;
 }
        private void SortPoints()
        {
            for (int i = 1; i < 3; i++)
            {
                if (points[i - 1].Position.Y > points[i].Position.Y)
                {
                    VertexPositionColor2D p = points[i - 1];
                    points[i - 1] = points[i];
                    points[i]     = p;

                    if (i > 1)
                    {
                        i -= 2;
                    }
                }
            }
            sorted = true;
        }