This is my first jogl program, and i apologize if the question seems too basic or repeated.
I made a program that is supposed to represent a droplet of liquid diffusing into a glass of liquid. This is very simplistic, it is basically a grid where particles randomly move about, and I can’t imagine it being that cpu intensive. I use a two-dimensional long array to store the amount of particles in that cell. Then based on that I draw a polygon in that cell with a calculated intensity (darker = more particles in cell). I then have to iterate through the array and make the polygons.
the problem is that when the grid gets large, and the amount of arrayPostions needed to check grows proportional to the square of the side, the animation runs smooth and that pauses, almost like it needs to catch up. This jitterying starts when the array is about 100x100, or 10000 cells.
How can I make the animation more smooth?
I don’t see a way to eliminate the need to iterate through all cells. If someone has any idea I would be very appreciative.