So I'm creating an EMP....
A graphical one that is.
The technique that I'm using is this:
-create a grid of points
-have them move around according to formulas
-render them where lines are drawn from point to adjacent point.
So, a particle in the array at [3],[3] would have lines connected to [2][3] & [3][2] & [4][3] & [3][4].
At first, I did the simplest thing:
loop through with Particle p,pp being onces that need to be connected
g.drawLine(p.x,p.y,pp.x,pp.y);
This was incredibly slow.
Then I instead added all points to a Polygon and called:
g.drawPolygon(poly);
This was much faster, but the problem is that the polygon method connects some points that i dont want to be connected and doesn't connect others that i want to be connected.
Is there an algorithm for the order to add points to the polygon in order for it to correctly draw a grid with as little overlapping lines as possible?
Thanks!

