Hi Guys, i try to move an object over a grid. The problem is that between the points i am getting very short stuttering. So i thought i would need to find lines in my point list Like that:
List<Point2> sample = new List<Point2>()
{
new Point2(5,5),
new Point2(4,5),
new Point2(3,5),
new Point2(3,4),
new Point2(3,3),
new Point2(2,3)
};
// this is what the algorithim needs to return me ==>
List<List<Point2>> result = new List<List<Point2>>();
result.Add(new List<Point2>() { new Point2(5, 5), new Point2(4, 5), new Point2(3, 5) });
result.Add(new List<Point2>() { new Point2(3, 5), new Point2(3, 4), new Point2(3, 3) });
result.Add(new List<Point2>() { new Point2(3, 3), new Point2(2, 3) });
/////////////////////////////////////////////////
List<Point2> sample2 = new List<Point2>()
{
new Point2(1,2),
new Point2(2,2)
};
// this is what i need ==>
List<List<Point2>> result2 = new List<List<Point2>>();
result.Add(new List<Point2>() { new Point2(1, 2), new Point2(2, 2) });
Maybe anyone has the time to help me out here.